Class: Maimailog::Data::Detail::Score

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

Overview

スコア

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeScore

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

#breakObject

Returns the value of attribute break.



29
30
31
# File 'lib/maimailog/data/detail.rb', line 29

def break
  @break
end

#break_maxObject

Returns the value of attribute break_max.



29
30
31
# File 'lib/maimailog/data/detail.rb', line 29

def break_max
  @break_max
end

#holdObject

Returns the value of attribute hold.



29
30
31
# File 'lib/maimailog/data/detail.rb', line 29

def hold
  @hold
end

#hold_maxObject

Returns the value of attribute hold_max.



29
30
31
# File 'lib/maimailog/data/detail.rb', line 29

def hold_max
  @hold_max
end

#slideObject

Returns the value of attribute slide.



29
30
31
# File 'lib/maimailog/data/detail.rb', line 29

def slide
  @slide
end

#slide_maxObject

Returns the value of attribute slide_max.



29
30
31
# File 'lib/maimailog/data/detail.rb', line 29

def slide_max
  @slide_max
end

#tapObject

Returns the value of attribute tap.



29
30
31
# File 'lib/maimailog/data/detail.rb', line 29

def tap
  @tap
end

#tap_maxObject

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

#rateObject



50
51
52
# File 'lib/maimailog/data/detail.rb', line 50

def rate
  (total / total_max.to_f * 10000).floor / 100.0
end

#totalObject



42
43
44
# File 'lib/maimailog/data/detail.rb', line 42

def total
  @tap + @hold + @slide + @break
end

#total_maxObject



46
47
48
# File 'lib/maimailog/data/detail.rb', line 46

def total_max
  @tap_max + @hold_max + @slide_max + @break_max
end