Class: Vng::SystemOption
Overview
Provides methods to interact with Vonigo system fields’ options.
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id:, name:) ⇒ SystemOption
constructor
A new instance of SystemOption.
Constructor Details
#initialize(id:, name:) ⇒ SystemOption
Returns a new instance of SystemOption.
6 7 8 9 |
# File 'lib/vng/system_option.rb', line 6 def initialize(id:, name:) @id = id @name = name end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/vng/system_option.rb', line 4 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/vng/system_option.rb', line 4 def name @name end |
Class Method Details
.for_system_field_id(system_field_id, options = {}) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/vng/system_option.rb', line 11 def self.for_system_field_id(system_field_id, = {}) .lazy.filter_map do |option| next unless active?(option) if option['fieldID'].eql? system_field_id new id: option['optionID'], name: option['name'] end end # TODO: make this thing respond to find_by(name:) end |