Class: MLB::DerbyHomeRun

Inherits:
Shale::Mapper
  • Object
show all
Defined in:
lib/mlb/home_run_derby.rb

Overview

Represents a home run in the derby

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#is_bonus_timeBoolean

Returns whether this was hit during bonus time

Examples:

hr.bonus_time? #=> false

Returns:

  • (Boolean)

    whether bonus time



37
# File 'lib/mlb/home_run_derby.rb', line 37

attribute :is_bonus_time, Shale::Type::Boolean

#launch_angleFloat

Returns the launch angle

Examples:

hr.launch_angle #=> 28.5

Returns:

  • (Float)

    the launch angle in degrees



29
# File 'lib/mlb/home_run_derby.rb', line 29

attribute :launch_angle, Shale::Type::Float

#launch_speedFloat

Returns the launch speed

Examples:

hr.launch_speed #=> 112.5

Returns:

  • (Float)

    the launch speed in mph



21
# File 'lib/mlb/home_run_derby.rb', line 21

attribute :launch_speed, Shale::Type::Float

#total_distanceInteger

Returns the total distance of the home run

Examples:

hr.total_distance #=> 450

Returns:

  • (Integer)

    the distance in feet



13
# File 'lib/mlb/home_run_derby.rb', line 13

attribute :total_distance, Shale::Type::Integer

Instance Method Details

#bonus_time?Boolean

Returns whether this home run was during bonus time

Examples:

hr.bonus_time? #=> false

Returns:

  • (Boolean)

    whether bonus time



45
46
47
# File 'lib/mlb/home_run_derby.rb', line 45

def bonus_time?
  is_bonus_time
end