class Account

Attributes

accountname[R]
folder[RW]
id[R]
ose_secret[R]
password[R]
type[R]
username[R]

Public Class Methods

find(id) click to toggle source
# File lib/models/account.rb, line 30
def find(id)
  AccountSerializer.from_json(CryptopusAdapter.new.get("accounts/#{id}"))
end
find_by_name_and_folder_id(name, id) click to toggle source
# File lib/models/account.rb, line 34
def find_by_name_and_folder_id(name, id)
  Folder.find(id).accounts.find do |account|
    account.accountname.downcase == name.downcase
  end
end
from_json(json) click to toggle source
# File lib/models/account.rb, line 40
def from_json(json)
  AccountSerializer.from_json(json)
end
new(accountname: nil, username: nil, password: nil, ose_secret: nil, type: nil, id: nil) click to toggle source
# File lib/models/account.rb, line 7
def initialize(accountname: nil, username: nil, password: nil,
               ose_secret: nil, type: nil, id: nil)
  @id = id
  @accountname = accountname
  @username = username
  @password = password
  @ose_secret = ose_secret
  @type = type || 'credentials'
end

Public Instance Methods

to_json(*_args) click to toggle source
# File lib/models/account.rb, line 17
def to_json(*_args)
  AccountSerializer.to_json(self)
end
to_osesecret() click to toggle source
# File lib/models/account.rb, line 25
def to_osesecret
  AccountSerializer.to_osesecret(self)
end
to_yaml() click to toggle source
# File lib/models/account.rb, line 21
def to_yaml
  AccountSerializer.to_yaml(self)
end