Class: Io::Flow::V0::Models::AuthenticationForm

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ AuthenticationForm

Returns a new instance of AuthenticationForm.



22874
22875
22876
22877
22878
22879
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22874

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:email, :password], 'AuthenticationForm')
  @email = HttpClient::Preconditions.assert_class('email', opts.delete(:email), String)
  @password = HttpClient::Preconditions.assert_class('password', opts.delete(:password), String)
end

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



22872
22873
22874
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22872

def email
  @email
end

#passwordObject (readonly)

Returns the value of attribute password.



22872
22873
22874
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22872

def password
  @password
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



22885
22886
22887
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22885

def copy(incoming={})
  AuthenticationForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



22889
22890
22891
22892
22893
22894
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22889

def to_hash
  {
    :email => email,
    :password => password
  }
end

#to_jsonObject



22881
22882
22883
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22881

def to_json
  JSON.dump(to_hash)
end