Class: Maimailog::Data::Detail::Score
- Inherits:
-
Object
- Object
- Maimailog::Data::Detail::Score
- Defined in:
- lib/maimailog/data/detail.rb
Overview
スコア
Instance Attribute Summary collapse
-
#break ⇒ Object
Returns the value of attribute break.
-
#break_max ⇒ Object
Returns the value of attribute break_max.
-
#hold ⇒ Object
Returns the value of attribute hold.
-
#hold_max ⇒ Object
Returns the value of attribute hold_max.
-
#slide ⇒ Object
Returns the value of attribute slide.
-
#slide_max ⇒ Object
Returns the value of attribute slide_max.
-
#tap ⇒ Object
Returns the value of attribute tap.
-
#tap_max ⇒ Object
Returns the value of attribute tap_max.
Instance Method Summary collapse
-
#initialize ⇒ Score
constructor
A new instance of Score.
- #rate ⇒ Object
- #total ⇒ Object
- #total_max ⇒ Object
Constructor Details
#initialize ⇒ Score
Returns a new instance of Score.
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/maimailog/data/detail.rb', line 31 def initialize @tap = 0 @hold = 0 @slide = 0 @break = 0 @tap_max = 0 @hold_max = 0 @slide_max = 0 @break_max = 0 end |
Instance Attribute Details
#break ⇒ Object
Returns the value of attribute break.
29 30 31 |
# File 'lib/maimailog/data/detail.rb', line 29 def break @break end |
#break_max ⇒ Object
Returns the value of attribute break_max.
29 30 31 |
# File 'lib/maimailog/data/detail.rb', line 29 def break_max @break_max end |
#hold ⇒ Object
Returns the value of attribute hold.
29 30 31 |
# File 'lib/maimailog/data/detail.rb', line 29 def hold @hold end |
#hold_max ⇒ Object
Returns the value of attribute hold_max.
29 30 31 |
# File 'lib/maimailog/data/detail.rb', line 29 def hold_max @hold_max end |
#slide ⇒ Object
Returns the value of attribute slide.
29 30 31 |
# File 'lib/maimailog/data/detail.rb', line 29 def @slide end |
#slide_max ⇒ Object
Returns the value of attribute slide_max.
29 30 31 |
# File 'lib/maimailog/data/detail.rb', line 29 def @slide_max end |
#tap ⇒ Object
Returns the value of attribute tap.
29 30 31 |
# File 'lib/maimailog/data/detail.rb', line 29 def tap @tap end |
#tap_max ⇒ Object
Returns the value of attribute tap_max.
29 30 31 |
# File 'lib/maimailog/data/detail.rb', line 29 def tap_max @tap_max end |
Instance Method Details
#rate ⇒ Object
50 51 52 |
# File 'lib/maimailog/data/detail.rb', line 50 def rate (total / total_max.to_f * 10000).floor / 100.0 end |
#total ⇒ Object
42 43 44 |
# File 'lib/maimailog/data/detail.rb', line 42 def total @tap + @hold + @slide + @break end |
#total_max ⇒ Object
46 47 48 |
# File 'lib/maimailog/data/detail.rb', line 46 def total_max @tap_max + @hold_max + @slide_max + @break_max end |