Class: Io::Flow::V0::Models::InputSpecification
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::InputSpecification
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#display_text ⇒ Object
readonly
Returns the value of attribute display_text.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ InputSpecification
constructor
A new instance of InputSpecification.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ InputSpecification
Returns a new instance of InputSpecification.
42698 42699 42700 42701 42702 42703 42704 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42698 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:type, :name], 'InputSpecification') @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::InputSpecificationType) ? x : ::Io::Flow::V0::Models::InputSpecificationType.apply(x)) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @display_text = (x = opts.delete(:display_text); x.nil? ? nil : HttpClient::Preconditions.assert_class('display_text', x, String)) end |
Instance Attribute Details
#display_text ⇒ Object (readonly)
Returns the value of attribute display_text.
42696 42697 42698 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42696 def display_text @display_text end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
42696 42697 42698 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42696 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
42696 42697 42698 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42696 def type @type end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
42710 42711 42712 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42710 def copy(incoming={}) InputSpecification.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
42714 42715 42716 42717 42718 42719 42720 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42714 def to_hash { :type => type.value, :name => name, :display_text => display_text } end |
#to_json ⇒ Object
42706 42707 42708 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42706 def to_json JSON.dump(to_hash) end |