class Lifen::Settings

Public Instance Methods

refresh()
Alias for: reload
reload() click to toggle source
# File lib/lifen/settings.rb, line 11
def reload
  json = client.get("central/api/settings")

  load_from_json(json)

  self
end
Also aliased as: refresh
save() click to toggle source
# File lib/lifen/settings.rb, line 21
def save
  params = {"emailNotifications" => email_notifications, "pushNotifications" => push_notifications}

  json = client.post("central/api/settings", params)

  load_from_json(json)

  self
end

Private Instance Methods

client() click to toggle source
# File lib/lifen/settings.rb, line 33
def client
  @client ||= user.client
end
load_from_json(json) click to toggle source
# File lib/lifen/settings.rb, line 37
def load_from_json(json)
  self.email_notifications    = json["emailNotifications"]
  self.push_notifications     = json["pushNotifications"]
end