Class: RKit::Grid::Binding
Defined Under Namespace
Classes: Attributes
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#block ⇒ Object
Returns the value of attribute block.
-
#col_attributes ⇒ Object
Returns the value of attribute col_attributes.
-
#col_size ⇒ Object
Returns the value of attribute col_size.
-
#row_attributes ⇒ Object
Returns the value of attribute row_attributes.
-
#view_context ⇒ Object
Returns the value of attribute view_context.
Instance Method Summary collapse
- #capture(object) ⇒ Object
-
#initialize ⇒ Binding
constructor
A new instance of Binding.
- #mass_assign(assigns) ⇒ Object
Constructor Details
#initialize ⇒ Binding
Returns a new instance of Binding.
5 6 7 8 9 10 11 12 |
# File 'lib/r_kit/grid/binding.rb', line 5 def initialize @view_context = ActionView::Base.new @block = ->(object){ object.to_s } @attributes = Attributes.new @row_attributes = Attributes.new @col_attributes = Attributes.new end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
2 3 4 |
# File 'lib/r_kit/grid/binding.rb', line 2 def attributes @attributes end |
#block ⇒ Object
Returns the value of attribute block.
2 3 4 |
# File 'lib/r_kit/grid/binding.rb', line 2 def block @block end |
#col_attributes ⇒ Object
Returns the value of attribute col_attributes.
2 3 4 |
# File 'lib/r_kit/grid/binding.rb', line 2 def col_attributes @col_attributes end |
#col_size ⇒ Object
Returns the value of attribute col_size.
2 3 4 |
# File 'lib/r_kit/grid/binding.rb', line 2 def col_size @col_size end |
#row_attributes ⇒ Object
Returns the value of attribute row_attributes.
2 3 4 |
# File 'lib/r_kit/grid/binding.rb', line 2 def row_attributes @row_attributes end |
#view_context ⇒ Object
Returns the value of attribute view_context.
2 3 4 |
# File 'lib/r_kit/grid/binding.rb', line 2 def view_context @view_context end |
Instance Method Details
#capture(object) ⇒ Object
37 38 39 |
# File 'lib/r_kit/grid/binding.rb', line 37 def capture object block.call object end |
#mass_assign(assigns) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/r_kit/grid/binding.rb', line 28 def mass_assign assigns assigns.each do |binding, value| if respond_to? "#{ binding }=" send "#{ binding }=", value end end end |