Class: NbaRb::ShotClockRange

Inherits:
Object
  • Object
show all
Defined in:
lib/nba_rb/constants.rb

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.all_rangesObject

Returns the value of attribute all_ranges.



184
185
186
# File 'lib/nba_rb/constants.rb', line 184

def all_ranges
  @all_ranges
end

.defaultObject

Returns the value of attribute default.



184
185
186
# File 'lib/nba_rb/constants.rb', line 184

def default
  @default
end

.shot_clock_offObject

Returns the value of attribute shot_clock_off.



184
185
186
# File 'lib/nba_rb/constants.rb', line 184

def shot_clock_off
  @shot_clock_off
end

Instance Method Details

#get(n) ⇒ Object



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/nba_rb/constants.rb', line 193

def get(n)
  if n > 24 or n < 0
    return ''
  elsif 22 <= n <= 24
    return '24-22'
  elsif 18 <= n < 22
    return '22-18 Very Early'
  elsif 15 <= n < 18
    return '18-15 Early'
  elsif 7 <= n < 15
    return '15-7 Average'
  elsif 4 <= n < 7
    return '7-4 Late'
  elsif 0 <= n < 4
    return '4-0 Very Late'
  end
end