Class: Hyperscore::Client
- Inherits:
-
Object
- Object
- Hyperscore::Client
- Includes:
- Hyperclient
- Defined in:
- lib/hyperscore/client.rb
Instance Method Summary collapse
- #games ⇒ Object
-
#initialize(url = nil) ⇒ Client
constructor
A new instance of Client.
- #motd ⇒ Object
- #news ⇒ Object
- #submissions ⇒ Object
Constructor Details
#initialize(url = nil) ⇒ Client
Returns a new instance of Client.
13 14 15 |
# File 'lib/hyperscore/client.rb', line 13 def initialize(url=nil) url and self.class.entry_point url end |
Instance Method Details
#games ⇒ Object
30 31 32 |
# File 'lib/hyperscore/client.rb', line 30 def games links.games.resources.games end |
#motd ⇒ Object
34 35 36 |
# File 'lib/hyperscore/client.rb', line 34 def motd attributes['motd'] end |
#news ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/hyperscore/client.rb', line 17 def news links.news.resources.news.map do |news| Hyperscore::Coercions::News.new( news.attributes.merge({ :source => news.url, :site => news.links['alternate'].url }) ) end end |
#submissions ⇒ Object
26 27 28 |
# File 'lib/hyperscore/client.rb', line 26 def submissions links.submissions.resources.submissions end |