Class: Valanga::MusicAttribute
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Valanga::MusicAttribute
- Defined in:
- lib/valanga/music_attribute.rb
Defined Under Namespace
Modules: Transformable
Instance Method Summary collapse
- #cleared? ⇒ Boolean
- #full_combo? ⇒ Boolean
-
#initialize(attribute) ⇒ MusicAttribute
constructor
A new instance of MusicAttribute.
- #played? ⇒ Boolean
Constructor Details
#initialize(attribute) ⇒ MusicAttribute
Returns a new instance of MusicAttribute.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/valanga/music_attribute.rb', line 5 def initialize(attribute) super attr = attribute.dup.extend(Transformable) self.rank = attr.rank self.score = attr.score self.achievement_rate = attr.achievement_rate self.miss_count = attr.miss_count self.play_count = attr.play_count self.clear = attr.clear self.full_combo = attr.full_combo end |
Instance Method Details
#cleared? ⇒ Boolean
18 19 20 |
# File 'lib/valanga/music_attribute.rb', line 18 def cleared? achievement_rate && 70.0 <= achievement_rate end |
#full_combo? ⇒ Boolean
26 27 28 |
# File 'lib/valanga/music_attribute.rb', line 26 def full_combo? ! full_combo.nil? end |
#played? ⇒ Boolean
22 23 24 |
# File 'lib/valanga/music_attribute.rb', line 22 def played? play_count > 0 end |