Class: Osu::API::BeatmapScore

Inherits:
Object
  • Object
show all
Includes:
GetRequest
Defined in:
lib/osu/api.rb

Instance Attribute Summary

Attributes included from GetRequest

#endpoint, #params

Instance Method Summary collapse

Methods included from GetRequest

#execute, #url

Constructor Details

#initialize(id, user: nil, mode: nil, mods: nil, limit: nil) ⇒ BeatmapScore

Returns a new instance of BeatmapScore.


48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/osu/api.rb', line 48

def initialize(id, user: nil, mode: nil, mods: nil, limit: nil)
  @endpoint = 'get_scores'

  @params = {}

  @params.merge! API.beatmap(id) if id
  @params.merge! API.user(user) if user
  @params.merge! API.mode(mode) if mode
  if mods
    mods = API::Mods.bits(mods) if mods.is_a? Array
    @params.merge! API.mods(mods)
  end
  @params.merge! API.limit(limit) if limit
end