Class: Vng::SystemField
Overview
Provides methods to interact with Vonigo system fields.
Constant Summary collapse
- PATH =
'/api/v1/system/objects/'
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id:, name:, options:) ⇒ SystemField
constructor
A new instance of SystemField.
Constructor Details
#initialize(id:, name:, options:) ⇒ SystemField
10 11 12 13 14 |
# File 'lib/vng/system_field.rb', line 10 def initialize(id:, name:, options:) @id = id @name = name = end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/vng/system_field.rb', line 8 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/vng/system_field.rb', line 8 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/vng/system_field.rb', line 8 def end |
Class Method Details
.for_system_object_id(system_object_id) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/vng/system_field.rb', line 16 def self.for_system_object_id(system_object_id) body = { objectID: system_object_id, method: '1' } data = request path: PATH, body: body data['Fields'].lazy.map do |field| = SystemOption.for_system_field_id field['fieldID'], data['Options'] new id: field['fieldID'], name: field['field'], options: end # TODO: make this thing respond to find_by(name:) end |