Class: MassShootings::Shooting
- Inherits:
-
Object
- Object
- MassShootings::Shooting
- Includes:
- ActiveModel::AttributeMethods
- Defined in:
- lib/mass_shootings/shooting.rb
Overview
A ‘MassShooting::Shooting` is when four or more people are shot in an event, or related series of events, likely without a cooling off period.
Instance Method Summary collapse
-
#attribute(name) ⇒ Object
Retrieves an attribute by name.
-
#initialize(attributes) ⇒ Shooting
constructor
Creates a new Shooting with the given attributes.
Constructor Details
#initialize(attributes) ⇒ Shooting
Creates a new Shooting with the given attributes.
34 35 36 |
# File 'lib/mass_shootings/shooting.rb', line 34 def initialize(attributes) @attributes = attributes end |
Instance Method Details
#attribute(name) ⇒ Object
Retrieves an attribute by name.
17 18 19 |
# File 'lib/mass_shootings/shooting.rb', line 17 def attribute(name) @attributes[name.to_sym] end |