Class: Io::Flow::V0::Models::OrganizationSession
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#local ⇒ Object
readonly
Returns the value of attribute local.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
Attributes inherited from Session
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrganizationSession
constructor
A new instance of OrganizationSession.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Session
Constructor Details
#initialize(incoming = {}) ⇒ OrganizationSession
Returns a new instance of OrganizationSession.
17695 17696 17697 17698 17699 17700 17701 17702 17703 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17695 def initialize(incoming={}) super(:discriminator => Session::Types::ORGANIZATION_SESSION) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :organization, :attributes], 'OrganizationSession') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String) @attributes = HttpClient::Preconditions.assert_class('attributes', opts.delete(:attributes), Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h } @local = (x = opts.delete(:local); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::LocalSession) ? x : ::Io::Flow::V0::Models::LocalSession.new(x))) end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
17693 17694 17695 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17693 def attributes @attributes end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
17693 17694 17695 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17693 def id @id end |
#local ⇒ Object (readonly)
Returns the value of attribute local.
17693 17694 17695 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17693 def local @local end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
17693 17694 17695 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17693 def organization @organization end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
17709 17710 17711 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17709 def copy(incoming={}) OrganizationSession.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
17713 17714 17715 17716 17717 17718 17719 17720 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17713 def subtype_to_hash { :id => id, :organization => organization, :attributes => attributes, :local => local.nil? ? nil : local.to_hash } end |
#to_json ⇒ Object
17705 17706 17707 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17705 def to_json JSON.dump(to_hash) end |