Class: Io::Flow::V0::Models::Channel
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::Channel
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#organization_id_prefix ⇒ Object
readonly
Returns the value of attribute organization_id_prefix.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ Channel
constructor
A new instance of Channel.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ Channel
Returns a new instance of Channel.
34800 34801 34802 34803 34804 34805 34806 34807 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34800 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :name, :environment], 'Channel') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @environment = (x = opts.delete(:environment); x.is_a?(::Io::Flow::V0::Models::Environment) ? x : ::Io::Flow::V0::Models::Environment.apply(x)) @organization_id_prefix = (x = opts.delete(:organization_id_prefix); x.nil? ? nil : HttpClient::Preconditions.assert_class('organization_id_prefix', x, String)) end |
Instance Attribute Details
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
34798 34799 34800 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34798 def environment @environment end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
34798 34799 34800 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34798 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
34798 34799 34800 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34798 def name @name end |
#organization_id_prefix ⇒ Object (readonly)
Returns the value of attribute organization_id_prefix.
34798 34799 34800 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34798 def organization_id_prefix @organization_id_prefix end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
34813 34814 34815 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34813 def copy(incoming={}) Channel.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
34817 34818 34819 34820 34821 34822 34823 34824 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34817 def to_hash { :id => id, :name => name, :environment => environment.value, :organization_id_prefix => organization_id_prefix } end |
#to_json ⇒ Object
34809 34810 34811 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34809 def to_json JSON.dump(to_hash) end |