Class: Io::Flow::V0::Models::ChannelOrganization
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ChannelOrganization
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
-
#defaults ⇒ Object
readonly
Returns the value of attribute defaults.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#slug ⇒ Object
readonly
Returns the value of attribute slug.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ChannelOrganization
constructor
A new instance of ChannelOrganization.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ChannelOrganization
Returns a new instance of ChannelOrganization.
30602 30603 30604 30605 30606 30607 30608 30609 30610 30611 30612 30613 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30602 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :organization, :key, :channel, :name, :defaults], 'ChannelOrganization') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @organization = (x = opts.delete(:organization); x.is_a?(::Io::Flow::V0::Models::OrganizationReference) ? x : ::Io::Flow::V0::Models::OrganizationReference.new(x)) @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String) @channel = (x = opts.delete(:channel); x.is_a?(::Io::Flow::V0::Models::ChannelReference) ? x : ::Io::Flow::V0::Models::ChannelReference.new(x)) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @slug = (x = opts.delete(:slug); x.nil? ? nil : HttpClient::Preconditions.assert_class('slug', x, String)) @defaults = (x = opts.delete(:defaults); x.is_a?(::Io::Flow::V0::Models::OrganizationDefaults) ? x : ::Io::Flow::V0::Models::OrganizationDefaults.new(x)) @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }) end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
30600 30601 30602 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30600 def attributes @attributes end |
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
30600 30601 30602 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30600 def channel @channel end |
#defaults ⇒ Object (readonly)
Returns the value of attribute defaults.
30600 30601 30602 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30600 def defaults @defaults end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
30600 30601 30602 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30600 def id @id end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
30600 30601 30602 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30600 def key @key end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
30600 30601 30602 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30600 def name @name end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
30600 30601 30602 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30600 def organization @organization end |
#slug ⇒ Object (readonly)
Returns the value of attribute slug.
30600 30601 30602 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30600 def slug @slug end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
30619 30620 30621 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30619 def copy(incoming={}) ChannelOrganization.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
30623 30624 30625 30626 30627 30628 30629 30630 30631 30632 30633 30634 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30623 def to_hash { :id => id, :organization => organization.to_hash, :key => key, :channel => channel.to_hash, :name => name, :slug => slug, :defaults => defaults.to_hash, :attributes => attributes.nil? ? nil : attributes } end |
#to_json ⇒ Object
30615 30616 30617 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30615 def to_json JSON.dump(to_hash) end |