Class: Io::Flow::V0::Models::OrganizationForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::OrganizationForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Either id or name is required.
Instance Attribute Summary collapse
-
#defaults ⇒ Object
readonly
Returns the value of attribute defaults.
-
#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.
-
#parent_id ⇒ Object
readonly
Returns the value of attribute parent_id.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrganizationForm
constructor
A new instance of OrganizationForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ OrganizationForm
Returns a new instance of OrganizationForm.
40111 40112 40113 40114 40115 40116 40117 40118 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40111 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) @id = (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, String)) @name = (x = opts.delete(:name); x.nil? ? nil : HttpClient::Preconditions.assert_class('name', x, String)) @environment = (x = (x = opts.delete(:environment); x.nil? ? "production" : x); x.is_a?(::Io::Flow::V0::Models::Environment) ? x : ::Io::Flow::V0::Models::Environment.apply(x)) @parent_id = (x = opts.delete(:parent_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('parent_id', x, String)) @defaults = (x = opts.delete(:defaults); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::OrganizationDefaults) ? x : ::Io::Flow::V0::Models::OrganizationDefaults.new(x))) end |
Instance Attribute Details
#defaults ⇒ Object (readonly)
Returns the value of attribute defaults.
40109 40110 40111 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40109 def defaults @defaults end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
40109 40110 40111 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40109 def environment @environment end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
40109 40110 40111 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40109 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
40109 40110 40111 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40109 def name @name end |
#parent_id ⇒ Object (readonly)
Returns the value of attribute parent_id.
40109 40110 40111 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40109 def parent_id @parent_id end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
40124 40125 40126 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40124 def copy(incoming={}) OrganizationForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
40128 40129 40130 40131 40132 40133 40134 40135 40136 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40128 def to_hash { :id => id, :name => name, :environment => environment.value, :parent_id => parent_id, :defaults => defaults.nil? ? nil : defaults.to_hash } end |
#to_json ⇒ Object
40120 40121 40122 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40120 def to_json JSON.dump(to_hash) end |