class PipeRocket::Field
Attributes
is_subfield[RW]
option_id[RW]
Public Class Methods
new(hash)
click to toggle source
Calls superclass method
PipeRocket::Entity::new
# File lib/pipe_rocket/field.rb, line 4 def initialize(hash) super @is_subfield ||= false end
Public Instance Methods
options_hash()
click to toggle source
Return hash {option_id: option_value}
# File lib/pipe_rocket/field.rb, line 10 def options_hash return {} unless @options @options.map{|option|{option['id'].to_s => option['label']}}.inject(:merge) end
value()
click to toggle source
Return value of field
# File lib/pipe_rocket/field.rb, line 16 def value options_hash[option_id] end