Class: Librails::FormParam

Inherits:
Object
  • Object
show all
Defined in:
app/models/librails/form_param.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, label = nil, value = nil) ⇒ FormParam

Returns a new instance of FormParam.



4
5
6
7
8
9
10
11
12
# File 'app/models/librails/form_param.rb', line 4

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

#idObject

Returns the value of attribute id.



13
14
15
# File 'app/models/librails/form_param.rb', line 13

def id
  @id
end

#labelObject

Returns the value of attribute label.



13
14
15
# File 'app/models/librails/form_param.rb', line 13

def label
  @label
end

#valueObject

Returns the value of attribute value.



13
14
15
# File 'app/models/librails/form_param.rb', line 13

def value
  @value
end