Class: Steam::Base

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

Direct Known Subclasses

Achievement, Game, Profile

Instance Method Summary collapse

Instance Method Details

#attribute_namesObject



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

def attribute_names
  @attribute_names
end

#attributesObject



7
8
9
10
11
# File 'lib/steam/base.rb', line 7

def attributes
  attribute_names.inject({}) do |attributes, name|
    attributes.merge name => instance_variable_get("@#{name}")
  end
end

#inspectObject



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/steam/base.rb', line 13

def inspect
  inspected_attributes = if @built_attributes
    attributes.map do |key, value|
      " #{key}=#{value.inspect}"
    end.join
  else
    ''
  end
  
  "#<#{self.class.name}:#{__id__}#{inspected_attributes}>"
end