Class: Librails::FormParam
- Inherits:
-
Object
- Object
- Librails::FormParam
- Defined in:
- lib/librails/form_param.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#label ⇒ Object
Returns the value of attribute label.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(id, label = nil, value = nil) ⇒ FormParam
constructor
A new instance of FormParam.
Constructor Details
#initialize(id, label = nil, value = nil) ⇒ FormParam
Returns a new instance of FormParam.
3 4 5 6 7 8 9 10 11 |
# File 'lib/librails/form_param.rb', line 3 def initialize(id, label = nil, value = nil) # 基本はIDとlabel。valueは特別な値を紐付けたい場合にのみ使用する。 @id = id @label = label if @label.nil? @label = @id end @value = value end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
12 13 14 |
# File 'lib/librails/form_param.rb', line 12 def id @id end |
#label ⇒ Object
Returns the value of attribute label.
12 13 14 |
# File 'lib/librails/form_param.rb', line 12 def label @label end |
#value ⇒ Object
Returns the value of attribute value.
12 13 14 |
# File 'lib/librails/form_param.rb', line 12 def value @value end |