Class: Hatsrank::Marketable

Inherits:
Object
  • Object
show all
Defined in:
lib/hatsrank/marketable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, uri) ⇒ Marketable

Returns a new instance of Marketable.



5
6
7
8
# File 'lib/hatsrank/marketable.rb', line 5

def initialize(client, uri)
  @uri = uri.sub('http://steamcommunity.com/', '')
  @client = client
end

Instance Attribute Details

#uriObject (readonly)

Returns the value of attribute uri.



3
4
5
# File 'lib/hatsrank/marketable.rb', line 3

def uri
  @uri
end

Instance Method Details

#infoObject



14
15
16
# File 'lib/hatsrank/marketable.rb', line 14

def info
  @client.hat_info self
end

#listingsObject



10
11
12
# File 'lib/hatsrank/marketable.rb', line 10

def listings
  @client.listings self
end

#nameObject



18
19
20
# File 'lib/hatsrank/marketable.rb', line 18

def name
  listings.first.name
end