class Datafiniti::User
Attributes
token[RW]
Public Class Methods
new(api_token=ENV['DATAFINITI_API_KEY'])
click to toggle source
# File lib/datafiniti/users.rb, line 6 def initialize(api_token=ENV['DATAFINITI_API_KEY']) self.token = api_token end
Public Instance Methods
method_missing(name, *args, &block)
click to toggle source
Calls superclass method
# File lib/datafiniti/users.rb, line 19 def method_missing(name, *args, &block) profile.has_key?(name.to_s) ? profile[name.to_s] : super # profile.has_key?(name.to_s) ? profile.send(name.to_sym) : super end
profile(force=false)
click to toggle source
# File lib/datafiniti/users.rb, line 15 def profile(force=false) force ? @profile = get_profile : @profile ||= get_profile end
Private Instance Methods
get_profile()
click to toggle source
# File lib/datafiniti/users.rb, line 26 def get_profile JSON.parse(self.class.get "/v2/users/#{self.token}") end