Class: MLB::EventType

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

Overview

Represents a baseball event type

Instance Attribute Summary collapse

Instance Attribute Details

#base_running_eventBoolean Also known as: base_running_event?

Returns whether this event involves base running

Examples:

event_type.base_running_event #=> false

Returns:

  • (Boolean)

    whether this event involves base running



47
# File 'lib/mlb/event_type.rb', line 47

attribute :base_running_event, Shale::Type::Boolean

#codeString

Returns the event code

Examples:

event_type.code #=> "single"

Returns:

  • (String)

    the event code



15
# File 'lib/mlb/event_type.rb', line 15

attribute :code, Shale::Type::String

#descriptionString

Returns the event description

Examples:

event_type.description #=> "Single"

Returns:

  • (String)

    the event description



23
# File 'lib/mlb/event_type.rb', line 23

attribute :description, Shale::Type::String

#hitBoolean Also known as: hit?

Returns whether this event is a hit

Examples:

event_type.hit #=> true

Returns:

  • (Boolean)

    whether this event is a hit



39
# File 'lib/mlb/event_type.rb', line 39

attribute :hit, Shale::Type::Boolean

#plate_appearanceBoolean Also known as: plate_appearance?

Returns whether this event counts as a plate appearance

Examples:

event_type.plate_appearance #=> true

Returns:

  • (Boolean)

    whether this event counts as a plate appearance



31
# File 'lib/mlb/event_type.rb', line 31

attribute :plate_appearance, Shale::Type::Boolean