Class: Valanga::Music

Inherits:
Object
  • Object
show all
Defined in:
lib/valanga/music.rb,
lib/valanga/music/base.rb,
lib/valanga/music/collete.rb,
lib/valanga/music/groovin.rb

Defined Under Namespace

Classes: Base, Collete, Groovin

Instance Method Summary collapse

Constructor Details

#initialize(document) ⇒ Music

Returns a new instance of Music.



3
4
5
# File 'lib/valanga/music.rb', line 3

def initialize(document)
  @document = Nokogiri::HTML.parse(document, nil, 'Shift_JIS')
end

Instance Method Details

#artistObject



39
40
41
# File 'lib/valanga/music.rb', line 39

def artist
  @artist ||= @document.css("div.music_artist h6").text
end

#basicObject



7
8
9
# File 'lib/valanga/music.rb', line 7

def basic
  Difficulty::Basic.new(self)
end

#colleteObject



23
24
25
# File 'lib/valanga/music.rb', line 23

def collete
  Collete.new(self)
end

#groovinObject



27
28
29
# File 'lib/valanga/music.rb', line 27

def groovin
  Groovin.new(self)
end

#hardObject



15
16
17
# File 'lib/valanga/music.rb', line 15

def hard
  Difficulty::Hard.new(self)
end

#has_special?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/valanga/music.rb', line 31

def has_special?
  music_bk.size == 9
end

#mediumObject



11
12
13
# File 'lib/valanga/music.rb', line 11

def medium
  Difficulty::Medium.new(self)
end

#nameObject



35
36
37
# File 'lib/valanga/music.rb', line 35

def name
  @name ||= @document.css("div.music_dataname h6").text
end

#specialObject



19
20
21
# File 'lib/valanga/music.rb', line 19

def special
  Difficulty::Special.new(self)
end