Class: Osu::BeatmapSet

Inherits:
Object
  • Object
show all
Defined in:
lib/osu/data.rb

Overview

A collection of Beatmaps

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(beatmaps) ⇒ BeatmapSet

Returns a new instance of BeatmapSet.


287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
# File 'lib/osu/data.rb', line 287

def initialize(beatmaps)
  raise 'Must supply Array<Beatmap> with at least one element' unless beatmaps.is_a?(Array) && beatmaps.first.is_a?(Beatmap)
  @beatmaps = beatmaps

  map = beatmaps.first

  @id = map.set_id

  @approval = map.approval

  @mode = map.mode

  @artist = map.artist

  @title = map.title

  @creator = map.creator

  @source = map.source
end

Instance Attribute Details

#approvalSymbol (readonly)

Returns approval status of this map (see API::APPROVAL).

Returns:

  • (Symbol)

    approval status of this map (see API::APPROVAL)


270
271
272
# File 'lib/osu/data.rb', line 270

def approval
  @approval
end

#artistString (readonly)

Returns:

  • (String)

276
277
278
# File 'lib/osu/data.rb', line 276

def artist
  @artist
end

#beatmapsArray<Beatmap> (readonly) Also known as: maps

Returns the beatmaps contained in this set.

Returns:

  • (Array<Beatmap>)

    the beatmaps contained in this set


263
264
265
# File 'lib/osu/data.rb', line 263

def beatmaps
  @beatmaps
end

#creatorString (readonly)

Returns:

  • (String)

282
283
284
# File 'lib/osu/data.rb', line 282

def creator
  @creator
end

#idInteger (readonly)

Returns beatmap set ID.

Returns:

  • (Integer)

    beatmap set ID


267
268
269
# File 'lib/osu/data.rb', line 267

def id
  @id
end

#modeSymbol (readonly)

Returns:

  • (Symbol)

273
274
275
# File 'lib/osu/data.rb', line 273

def mode
  @mode
end

#sourceString (readonly)

Returns:

  • (String)

285
286
287
# File 'lib/osu/data.rb', line 285

def source
  @source
end

#titleString (readonly)

Returns:

  • (String)

279
280
281
# File 'lib/osu/data.rb', line 279

def title
  @title
end

Instance Method Details

#urlString

Returns url to this beatmap set's profile.

Returns:

  • (String)

    url to this beatmap set's profile


309
310
311
# File 'lib/osu/data.rb', line 309

def url
  "#{API::BASE_URL}/s/#{id}"
end