| Total Complexity | 5 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | # frozen_string_literal: true |
||
| 6 | class Vista < Hash |
||
| 7 | # TODO: Non default carousel and breadcrumb should be accesor |
||
| 8 | attr_accessor :ruta, :title, :subtitle, :template |
||
| 9 | |||
| 10 | def initialize(args) |
||
| 11 | args.each do |k, v| |
||
| 12 | instance_variable_set("@#{k}", v) unless v.nil? |
||
| 13 | end |
||
| 14 | end |
||
| 15 | |||
| 16 | def breadcrumb? |
||
| 17 | ruta != 'inicio' # default |
||
| 18 | # TODO: Missing non-default behaviour |
||
| 19 | end |
||
| 20 | |||
| 21 | def carousel? |
||
| 22 | ruta == 'inicio' |
||
| 23 | # TODO: Renegados |
||
| 24 | end |
||
| 25 | |||
| 26 | def breadcrumb |
||
| 27 | if breadcrumb? |
||
| 28 | [] # TODO: This should return an array |
||
| 29 | else |
||
| 30 | false |
||
| 31 | end |
||
| 32 | end |
||
| 33 | end |
||
| 34 |