Class: Expo2::SubCollection
- Inherits:
-
Struct
- Object
- Struct
- Expo2::SubCollection
- Defined in:
- lib/expo2.rb
Instance Attribute Summary collapse
-
#associator ⇒ Object
Returns the value of attribute associator.
-
#block ⇒ Object
Returns the value of attribute block.
-
#key ⇒ Object
Returns the value of attribute key.
-
#sub_expo ⇒ Object
Returns the value of attribute sub_expo.
Instance Method Summary collapse
Instance Attribute Details
#associator ⇒ Object
Returns the value of attribute associator
119 120 121 |
# File 'lib/expo2.rb', line 119 def associator @associator end |
#block ⇒ Object
Returns the value of attribute block
119 120 121 |
# File 'lib/expo2.rb', line 119 def block @block end |
#key ⇒ Object
Returns the value of attribute key
119 120 121 |
# File 'lib/expo2.rb', line 119 def key @key end |
#sub_expo ⇒ Object
Returns the value of attribute sub_expo
119 120 121 |
# File 'lib/expo2.rb', line 119 def sub_expo @sub_expo end |
Instance Method Details
#go(object, context, index = nil) ⇒ Object
120 121 122 123 124 |
# File 'lib/expo2.rb', line 120 def go(object, context, index=nil) associated = self.associator.to_proc.call(object) sub = Expo2.new(self.sub_expo, &self.block) { self.key => sub.expo_collection(associated, context) } end |
#inspect ⇒ Object
125 126 127 |
# File 'lib/expo2.rb', line 125 def inspect "<Expo2::SubCollection>" end |