Class: Assist::Player

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/Assist/player.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(username) ⇒ Player

Returns a new instance of Player.



13
14
15
# File 'lib/Assist/player.rb', line 13

def initialize(username)
  self.username = username
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



9
10
11
# File 'lib/Assist/player.rb', line 9

def method_missing(name, *args, &block)
  profile.fetch(name.to_s) { super }
end

Instance Attribute Details

#usernameObject

Returns the value of attribute username.



4
5
6
# File 'lib/Assist/player.rb', line 4

def username
  @username
end

Instance Method Details

#profile(force = false) ⇒ Object



17
18
19
# File 'lib/Assist/player.rb', line 17

def profile
  @get_profile ||= get_profile
end