Class: PipedriveJetrockets::Field
- Defined in:
- lib/pipedrive_jetrockets/field.rb
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
- #value ⇒ Object
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/pipedrive_jetrockets/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/pipedrive_jetrockets/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/pipedrive_jetrockets/field.rb', line 3 def option_id @option_id end |
Instance Method Details
#options_hash ⇒ Object
9 10 11 12 |
# File 'lib/pipedrive_jetrockets/field.rb', line 9 def return {} unless @options @options.map{|option|{option['id'].to_s => option['label']}}.inject(:merge) end |
#value ⇒ Object
14 15 16 |
# File 'lib/pipedrive_jetrockets/field.rb', line 14 def value [option_id] end |