Class: Rito::Shard

Inherits:
ApiBase show all
Defined in:
lib/rito/shard.rb

Defined Under Namespace

Classes: Incident, Message, Service, Translation

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiBase

#attributes=, call_api, from_list, from_map, from_map_of_lists

Constructor Details

#initialize(attributes = {}) ⇒ Shard


10
11
12
13
# File 'lib/rito/shard.rb', line 10

def initialize(attributes = {})
	self.services = Rito::Shard::Service.from_list(attributes.delete('services')) if attributes['services']
	super
end

Instance Attribute Details

#hostnameObject

Returns the value of attribute hostname


3
4
5
# File 'lib/rito/shard.rb', line 3

def hostname
  @hostname
end

#localesObject

Returns the value of attribute locales


3
4
5
# File 'lib/rito/shard.rb', line 3

def locales
  @locales
end

#nameObject

Returns the value of attribute name


3
4
5
# File 'lib/rito/shard.rb', line 3

def name
  @name
end

#region_tagObject

Returns the value of attribute region_tag


3
4
5
# File 'lib/rito/shard.rb', line 3

def region_tag
  @region_tag
end

#servicesObject

Returns the value of attribute services


3
4
5
# File 'lib/rito/shard.rb', line 3

def services
  @services
end

#slugObject

Returns the value of attribute slug


3
4
5
# File 'lib/rito/shard.rb', line 3

def slug
  @slug
end

Class Method Details

.allObject


16
17
18
19
20
# File 'lib/rito/shard.rb', line 16

def all
	url = root_url + "/shards"
	response = call_api(url)
	from_list(response)
end

.root_urlObject


28
29
30
# File 'lib/rito/shard.rb', line 28

def root_url
	"http://status.leagueoflegends.com"
end

.status_by_shard(shard) ⇒ Object


22
23
24
25
26
# File 'lib/rito/shard.rb', line 22

def status_by_shard(shard)
	url = root_url + "/shards/#{shard.downcase}"
	response = call_api(url)
	new(response)
end