Class: Expo2::Pres
- Inherits:
-
Struct
- Object
- Struct
- Expo2::Pres
- Defined in:
- lib/expo2.rb
Instance Attribute Summary collapse
-
#key_map ⇒ Object
Returns the value of attribute key_map.
-
#presenter ⇒ Object
Returns the value of attribute presenter.
Instance Method Summary collapse
Instance Attribute Details
#key_map ⇒ Object
Returns the value of attribute key_map
27 28 29 |
# File 'lib/expo2.rb', line 27 def key_map @key_map end |
#presenter ⇒ Object
Returns the value of attribute presenter
27 28 29 |
# File 'lib/expo2.rb', line 27 def presenter @presenter end |
Instance Method Details
#go(object, context, index = nil) ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/expo2.rb', line 28 def go(object, context, index=nil) preso = {} perspective = self.presenter.to_proc.call(object) self.key_map.each do |k,v| preso[v] = perspective.send(k) end preso end |
#inspect ⇒ Object
37 38 39 |
# File 'lib/expo2.rb', line 37 def inspect "<Expo2::Pres>" end |