Class: Io::Flow::V0::Models::InvitationForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::InvitationForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ InvitationForm
constructor
A new instance of InvitationForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ InvitationForm
16556 16557 16558 16559 16560 16561 16562 16563 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16556 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:organization, :email], 'InvitationForm') @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String) @email = HttpClient::Preconditions.assert_class('email', opts.delete(:email), String) @name = (x = opts.delete(:name); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Name) ? x : ::Io::Flow::V0::Models::Name.new(x))) @role = (x = (x = opts.delete(:role); x.nil? ? "member" : x); x.is_a?(::Io::Flow::V0::Models::Role) ? x : ::Io::Flow::V0::Models::Role.apply(x)) end |
Instance Attribute Details
#email ⇒ Object (readonly)
Returns the value of attribute email.
16554 16555 16556 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16554 def email @email end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
16554 16555 16556 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16554 def name @name end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
16554 16555 16556 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16554 def organization @organization end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
16554 16555 16556 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16554 def role @role end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
16569 16570 16571 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16569 def copy(incoming={}) InvitationForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
16573 16574 16575 16576 16577 16578 16579 16580 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16573 def to_hash { :organization => organization, :email => email, :name => name.nil? ? nil : name.to_hash, :role => role.value } end |
#to_json ⇒ Object
16565 16566 16567 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16565 def to_json JSON.dump(to_hash) end |