missing module added

This commit is contained in:
danijoo
2013-12-30 13:24:42 +01:00
parent c72fbd450b
commit 08c8bf21c3

View File

@@ -0,0 +1,21 @@
require 'sightstone/modules/sightstone_base_module'
class DatadragonModule < SightstoneBaseModule
def initialize(sightstone)
@sightstone = sightstone
end
def version(optional={})
region = optional[:region] || @sightstone.region
uri = "http://ddragon.leagueoflegends.com/realms/#{region}.json"
response = _get_api_response(uri)
_parse_response(response) { |resp|
data = JSON.parse(resp)
return data['v']
}
end
end