class MassShootings::Shooting

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.

Public Class Methods

new(attributes) click to toggle source

Creates a new Shooting with the given attributes.

@param [Hash] attributes Information pertaining to the Shooting. @option attributes [String] id a unique identifier @option attributes [Array<String>] alleged_shooters (nil) the names of the

alleged shooters

@option attributes [Hash{Symbol => Integer}] casualties count of

casualties, classified by type (`:dead` or `:injured`)

@option attributes [Date] date date the shooting occurred @option attributes [String] location where the shooting occurred @option attributes [Array<URI>] references links to relevant news sources

# File lib/mass_shootings/shooting.rb, line 34
def initialize(attributes)
  @attributes = attributes
end

Public Instance Methods

attribute(name) click to toggle source

Retrieves an attribute by name.

# File lib/mass_shootings/shooting.rb, line 17
def attribute(name)
  @attributes[name.to_sym]
end