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