class MasterLeague::HeroRepository
Public Instance Methods
order(order)
click to toggle source
# File lib/master_league/hero_repository.rb, line 5 def order(order) raise 'The Heroes endpoint does not allow ordering' end
Private Instance Methods
instantiate_record(hero_json)
click to toggle source
# File lib/master_league/hero_repository.rb, line 15 def instantiate_record(hero_json) hero_json[:role_id] = hero_json.delete('role') Hero.new(hero_json) end
instantiate_records(heroes_json)
click to toggle source
# File lib/master_league/hero_repository.rb, line 11 def instantiate_records(heroes_json) heroes_json['results'].map { |hero_json| instantiate_record(hero_json) } end