Class: Io::Flow::V0::Models::InputSpecification

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ InputSpecification



25585
25586
25587
25588
25589
25590
25591
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25585

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_textObject (readonly)

Returns the value of attribute display_text.



25583
25584
25585
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25583

def display_text
  @display_text
end

#nameObject (readonly)

Returns the value of attribute name.



25583
25584
25585
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25583

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



25583
25584
25585
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25583

def type
  @type
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



25597
25598
25599
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25597

def copy(incoming={})
  InputSpecification.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



25601
25602
25603
25604
25605
25606
25607
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25601

def to_hash
  {
    :type => type.value,
    :name => name,
    :display_text => display_text
  }
end

#to_jsonObject



25593
25594
25595
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25593

def to_json
  JSON.dump(to_hash)
end