class Kindara::Account

Public Class Methods

authenticate(email, password) click to toggle source
# File lib/kindara/account.rb, line 9
def self.authenticate(email, password)
  Kindara::Client.new(Kindara::Request.new("account", "auth", {"email" => email, "password" => password}))
end
info(client) click to toggle source

singleton method goes at the top

# File lib/kindara/account.rb, line 5
def self.info(client)
  new(Kindara::Request.new("account", "info", client.to_hash).call.fetch("account"))
end
new(payload) click to toggle source
# File lib/kindara/account.rb, line 13
def initialize(payload)
  @username = payload.fetch("username")
  @average_cycle = payload.fetch("average_cycle")
  @average_luteal = payload.fetch("average_luteal")
  @average_period = payload.fetch("average_period")
end

Public Instance Methods

average_cycle() click to toggle source
# File lib/kindara/account.rb, line 24
def average_cycle
  @average_cycle
end
average_luteal() click to toggle source
# File lib/kindara/account.rb, line 28
def average_luteal
  @average_luteal
end
average_period() click to toggle source
# File lib/kindara/account.rb, line 32
def average_period
  @average_period
end
username() click to toggle source
# File lib/kindara/account.rb, line 20
def username
  @username
end