Class: Expo2::SubExpo
- Inherits:
-
Struct
- Object
- Struct
- Expo2::SubExpo
- Defined in:
- lib/expo2.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#key ⇒ Object
Returns the value of attribute key.
-
#presenter ⇒ Object
Returns the value of attribute presenter.
-
#sub_expo ⇒ Object
Returns the value of attribute sub_expo.
Instance Method Summary collapse
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block
80 81 82 |
# File 'lib/expo2.rb', line 80 def block @block end |
#key ⇒ Object
Returns the value of attribute key
80 81 82 |
# File 'lib/expo2.rb', line 80 def key @key end |
#presenter ⇒ Object
Returns the value of attribute presenter
80 81 82 |
# File 'lib/expo2.rb', line 80 def presenter @presenter end |
#sub_expo ⇒ Object
Returns the value of attribute sub_expo
80 81 82 |
# File 'lib/expo2.rb', line 80 def sub_expo @sub_expo end |
Instance Method Details
#go(object, context, index = nil) ⇒ Object
81 82 83 84 85 86 87 88 89 |
# File 'lib/expo2.rb', line 81 def go(object, context, index=nil) associated = self.presenter.to_proc.call(object) sub = Expo2.new(self.sub_expo, &self.block) if associated { self.key => sub.expo(associated, context) } else {} end end |
#inspect ⇒ Object
90 91 92 |
# File 'lib/expo2.rb', line 90 def inspect "<Expo2::SubExpo>" end |