Class: Io::Flow::V0::Models::AttributeForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::AttributeForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ AttributeForm
constructor
A new instance of AttributeForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ AttributeForm
Returns a new instance of AttributeForm.
7424 7425 7426 7427 7428 7429 7430 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7424 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:key, :options], 'AttributeForm') @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String) @options = (x = opts.delete(:options); x.is_a?(::Io::Flow::V0::Models::Options) ? x : ::Io::Flow::V0::Models::Options.new(x)) @label = (x = opts.delete(:label); x.nil? ? nil : HttpClient::Preconditions.assert_class('label', x, String)) end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
7422 7423 7424 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7422 def key @key end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
7422 7423 7424 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7422 def label @label end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7422 7423 7424 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7422 def @options end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
7436 7437 7438 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7436 def copy(incoming={}) AttributeForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
7440 7441 7442 7443 7444 7445 7446 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7440 def to_hash { :key => key, :options => .to_hash, :label => label } end |
#to_json ⇒ Object
7432 7433 7434 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7432 def to_json JSON.dump(to_hash) end |