Class: Hyperscore::Client

Inherits:
Object
  • Object
show all
Includes:
Hyperclient
Defined in:
lib/hyperscore/client.rb

Instance Method Summary collapse

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

#gamesObject



30
31
32
# File 'lib/hyperscore/client.rb', line 30

def games
  links.games.resources.games
end

#motdObject



34
35
36
# File 'lib/hyperscore/client.rb', line 34

def motd
  attributes['motd']
end

#newsObject



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

#submissionsObject



26
27
28
# File 'lib/hyperscore/client.rb', line 26

def submissions
  links.submissions.resources.submissions
end