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
-
#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.
21079 21080 21081 21082 21083 21084 21085 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21079 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)) end |
Instance Attribute Details
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
21077 21078 21079 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21077 def environment @environment end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
21077 21078 21079 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21077 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
21077 21078 21079 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21077 def name @name end |
#parent_id ⇒ Object (readonly)
Returns the value of attribute parent_id.
21077 21078 21079 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21077 def parent_id @parent_id end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
21091 21092 21093 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21091 def copy(incoming={}) OrganizationForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
21095 21096 21097 21098 21099 21100 21101 21102 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21095 def to_hash { :id => id, :name => name, :environment => environment.value, :parent_id => parent_id } end |
#to_json ⇒ Object
21087 21088 21089 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21087 def to_json JSON.dump(to_hash) end |