Class: QuakeliveApi::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/quakelive_api/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(player_name) ⇒ Base

Returns a new instance of Base.



5
6
7
8
9
10
# File 'lib/quakelive_api/base.rb', line 5

def initialize(player_name)
  @player_name = player_name

  set_parser Nokogiri::HTML(get)
  setup_variables!
end

Instance Attribute Details

#player_nameObject

Returns the value of attribute player_name.



3
4
5
# File 'lib/quakelive_api/base.rb', line 3

def player_name
  @player_name
end

Instance Method Details

#inspectObject



12
13
14
15
16
17
# File 'lib/quakelive_api/base.rb', line 12

def inspect
  "#{self.class}:#{object_id}\n" + instance_variables.map do |v|
    next if v.to_s == "@parser"
    "#{v}=#{instance_variable_get(v).inspect}"
  end.compact.join("\n")
end