Class: PipeRocket::Field
Direct Known Subclasses
Instance Attribute Summary collapse
-
#is_subfield ⇒ Object
Returns the value of attribute is_subfield.
-
#option_id ⇒ Object
Returns the value of attribute option_id.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Field
constructor
A new instance of Field.
-
#options_hash ⇒ Object
Return hash option_value.
-
#value ⇒ Object
Return value of field.
Methods inherited from Entity
#assign_custom_fields, #transform_field_name
Constructor Details
#initialize(hash) ⇒ Field
Returns a new instance of Field.
4 5 6 7 |
# File 'lib/pipe_rocket/field.rb', line 4 def initialize(hash) super @is_subfield ||= false end |
Instance Attribute Details
#is_subfield ⇒ Object
Returns the value of attribute is_subfield.
3 4 5 |
# File 'lib/pipe_rocket/field.rb', line 3 def is_subfield @is_subfield end |
#option_id ⇒ Object
Returns the value of attribute option_id.
3 4 5 |
# File 'lib/pipe_rocket/field.rb', line 3 def option_id @option_id end |
Instance Method Details
#options_hash ⇒ Object
Return hash option_value
10 11 12 13 |
# File 'lib/pipe_rocket/field.rb', line 10 def return {} unless @options @options.map{|option|{option['id'].to_s => option['label']}}.inject(:merge) end |
#value ⇒ Object
Return value of field
16 17 18 |
# File 'lib/pipe_rocket/field.rb', line 16 def value [option_id] end |