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.



35592
35593
35594
35595
35596
35597
35598
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35592

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.



35590
35591
35592
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35590

def id
  @id
end

#typeObject (readonly)

Returns the value of attribute type.



35590
35591
35592
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35590

def type
  @type
end

#versionObject (readonly)

Returns the value of attribute version.



35590
35591
35592
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35590

def version
  @version
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



35604
35605
35606
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35604

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

#to_hashObject



35608
35609
35610
35611
35612
35613
35614
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35608

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

#to_jsonObject



35600
35601
35602
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35600

def to_json
  JSON.dump(to_hash)
end