Class: RKit::Grid::Binding::Attributes
- Inherits:
-
Object
- Object
- RKit::Grid::Binding::Attributes
- Defined in:
- lib/r_kit/grid/binding.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#initialize ⇒ Attributes
constructor
A new instance of Attributes.
- #process(value) ⇒ Object
Constructor Details
#initialize ⇒ Attributes
Returns a new instance of Attributes.
49 50 51 |
# File 'lib/r_kit/grid/binding.rb', line 49 def initialize @attributes = Hash.new{ |hash, key| hash[key] = Array.new } end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
47 48 49 |
# File 'lib/r_kit/grid/binding.rb', line 47 def attributes @attributes end |
Instance Method Details
#process(value) ⇒ Object
67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/r_kit/grid/binding.rb', line 67 def process value case value when Proc process(value.call) when Array value.map{ |unique_value| process(unique_value) }.join(" ") when String, Symbol value.to_s.dasherize else raise ArgumentError, "Must be Array, Proc or String/Symbol" end end |