Class: Authenticator::Client::Account

Inherits:
Object
  • Object
show all
Defined in:
lib/authenticator/client/account.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_json(json) ⇒ Object



7
8
9
10
11
12
# File 'lib/authenticator/client/account.rb', line 7

def self.from_json(json)
  params = json.each_with_object({}) do |(key, value), hash|
    hash[key.to_sym] = value
  end
  new(params)
end

Instance Method Details

#to_paramsObject Also known as: to_h



14
15
16
17
18
19
20
21
# File 'lib/authenticator/client/account.rb', line 14

def to_params
  {
    account: {
      id: id,
      password: password
    }
  }
end