lib/mass_shootings/shooting.rb
#
# Creates a Shooting from a JSON object.
# @return [Shooting]
#
Creates a Shooting from a JSON object.
Creates a Shooting from a JSON object .
def from_json(json)
        new(
          id:               json['id'],
          alleged_shooters: json['allegedShooters'],
          casualties:       json['casualties'].symbolize_keys,
          date:             Date.iso8601(json['date']),
          location:         json['location'],
          references:       json['references'].map(&method(:URI))
        )
      end
def from_json ( json ) new ( id : json [ 'id' ] , alleged_shooters : json [ 'allegedShooters' ] , casualties : json [ 'casualties' ] . symbolize_keys , date : Date . iso8601 ( json [ 'date' ] ) , location : json [ 'location' ] , references : json [ 'references' ] . map ( & method ( :URI ) ) ) end
Creates a Shooting from a JSON object.
Creates a Shooting from a JSON object .
None
Shooting
json