Class: Io::Flow::V0::Models::EcommercePlatform

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

Overview

The Ecommerce Platform defines what the organization is using for their ecommerce systems.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ EcommercePlatform

Returns a new instance of EcommercePlatform.



30895
30896
30897
30898
30899
30900
30901
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30895

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :type], 'EcommercePlatform')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::EcommercePlatformType) ? x : ::Io::Flow::V0::Models::EcommercePlatformType.apply(x))
  @version = (x = opts.delete(:version); x.nil? ? nil : HttpClient::Preconditions.assert_class('version', x, String))
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



30893
30894
30895
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30893

def id
  @id
end

#typeObject (readonly)

Returns the value of attribute type.



30893
30894
30895
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30893

def type
  @type
end

#versionObject (readonly)

Returns the value of attribute version.



30893
30894
30895
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30893

def version
  @version
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



30907
30908
30909
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30907

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

#to_hashObject



30911
30912
30913
30914
30915
30916
30917
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30911

def to_hash
  {
    :id => id,
    :type => type.value,
    :version => version
  }
end

#to_jsonObject



30903
30904
30905
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30903

def to_json
  JSON.dump(to_hash)
end