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

Returns a new instance of InputSpecification.



26058
26059
26060
26061
26062
26063
26064
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26058

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.



26056
26057
26058
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26056

def display_text
  @display_text
end

#nameObject (readonly)

Returns the value of attribute name.



26056
26057
26058
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26056

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



26056
26057
26058
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26056

def type
  @type
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



26070
26071
26072
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26070

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

#to_hashObject



26074
26075
26076
26077
26078
26079
26080
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26074

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

#to_jsonObject



26066
26067
26068
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26066

def to_json
  JSON.dump(to_hash)
end