Class: IngvQuake::FullInfoEvent
- Inherits:
-
Object
- Object
- IngvQuake::FullInfoEvent
- Defined in:
- lib/ingv_quake/models/full_info_event.rb
Overview
The FullInfoEvent class describes a seismic event which does not necessarily need to be a tectonic earthquake. An event is usually associated with one or more origins, which contain information about focal time and geographical location of the event.
Instance Attribute Summary collapse
-
#creation_info ⇒ CreationInfo
readonly
The creation info of the event.
-
#focal_mechanism ⇒ FocalMechanism
readonly
The focal mechanism of the event.
-
#location ⇒ String
readonly
The location of the event.
-
#location_description_type ⇒ String
readonly
The location of the event.
-
#magnitude ⇒ Magnitude
readonly
Reference to an associated Magnitude.
-
#origin ⇒ Origin
readonly
Reference to an associated Origin.
-
#preferred_focal_mechanism_id ⇒ String
readonly
Refers to the publicID of the preferred Focal Mechanism object.
-
#preferred_magnitude_id ⇒ String
readonly
Refers to the publicID of the preferred Magnitude object.
-
#preferred_origin_id ⇒ String
readonly
Refers to the publicID of the preferred Origin object.
-
#public_id ⇒ String
readonly
Resource identifier of Event.
-
#shake_map ⇒ ShakeMap
readonly
ShakeMap attributes are images that provides near-time maps of ground shaking for Magnitude >= 3.0 earthquakes in Italy and neighbouring areas.
-
#type ⇒ String
readonly
The type of the event.
Instance Method Summary collapse
-
#initialize(data:, shake_map: nil) ⇒ FullInfoEvent
constructor
Initializes a new FullInfoEvent instance with the provided data.
Constructor Details
#initialize(data:, shake_map: nil) ⇒ FullInfoEvent
Initializes a new FullInfoEvent instance with the provided data.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/ingv_quake/models/full_info_event.rb', line 37 def initialize(data:, shake_map: nil) @creation_info = data.fetch('creationInfo', nil)&.then { |creation_info_data| CreationInfo.new(creation_info_data) } @focal_mechanism = data.fetch('focalMechanism', nil)&.then { |focal_mechanism_data| FocalMechanism.new(focal_mechanism_data) } @location = data.dig('description', 'text') @location_description_type = data.dig('description', 'type') @magnitude = data.fetch('magnitude', nil)&.then { |magnitude_data| Magnitude.new(magnitude_data) } @origin = data.fetch('origin', nil)&.then { |origin_data| Origin.new(origin_data) } @preferred_focal_mechanism_id = data.fetch('preferredFocalMechanismID', nil) @preferred_magnitude_id = data.fetch('preferredMagnitudeID', nil) @preferred_origin_id = data.fetch('preferredOriginID', nil) @public_id = data.fetch('publicID', nil) @type = data.fetch('type', nil) @shake_map = shake_map&.then { |shake_map_data| ShakeMap.new(shake_map_data) } end |
Instance Attribute Details
#creation_info ⇒ CreationInfo (readonly)
The creation info of the event.
29 30 31 |
# File 'lib/ingv_quake/models/full_info_event.rb', line 29 def creation_info @creation_info end |
#focal_mechanism ⇒ FocalMechanism (readonly)
The focal mechanism of the event.
29 30 31 |
# File 'lib/ingv_quake/models/full_info_event.rb', line 29 def focal_mechanism @focal_mechanism end |
#location ⇒ String (readonly)
The location of the event.
29 30 31 |
# File 'lib/ingv_quake/models/full_info_event.rb', line 29 def location @location end |
#location_description_type ⇒ String (readonly)
The location of the event. Can be one of: ‘felt report’, ‘Flinn-Engdahl region’, ‘local time’, ‘tectonic summary’, ‘nearest cities’, ‘earthquake name’, ‘region name’.
29 30 31 |
# File 'lib/ingv_quake/models/full_info_event.rb', line 29 def location_description_type @location_description_type end |
#magnitude ⇒ Magnitude (readonly)
Reference to an associated Magnitude.
29 30 31 |
# File 'lib/ingv_quake/models/full_info_event.rb', line 29 def magnitude @magnitude end |
#origin ⇒ Origin (readonly)
Reference to an associated Origin.
29 30 31 |
# File 'lib/ingv_quake/models/full_info_event.rb', line 29 def origin @origin end |
#preferred_focal_mechanism_id ⇒ String (readonly)
Refers to the publicID of the preferred Focal Mechanism object.
29 30 31 |
# File 'lib/ingv_quake/models/full_info_event.rb', line 29 def preferred_focal_mechanism_id @preferred_focal_mechanism_id end |
#preferred_magnitude_id ⇒ String (readonly)
Refers to the publicID of the preferred Magnitude object.
29 30 31 |
# File 'lib/ingv_quake/models/full_info_event.rb', line 29 def preferred_magnitude_id @preferred_magnitude_id end |
#preferred_origin_id ⇒ String (readonly)
Refers to the publicID of the preferred Origin object.
29 30 31 |
# File 'lib/ingv_quake/models/full_info_event.rb', line 29 def preferred_origin_id @preferred_origin_id end |
#public_id ⇒ String (readonly)
Resource identifier of Event.
29 30 31 |
# File 'lib/ingv_quake/models/full_info_event.rb', line 29 def public_id @public_id end |
#shake_map ⇒ ShakeMap (readonly)
ShakeMap attributes are images that provides near-time maps of ground shaking for Magnitude >= 3.0 earthquakes in Italy and neighbouring areas. <b>This is a custom attribute.<b>
29 30 31 |
# File 'lib/ingv_quake/models/full_info_event.rb', line 29 def shake_map @shake_map end |
#type ⇒ String (readonly)
The type of the event. Can be one of: ‘not existing’, ‘not reported’, ‘earthquake’, ‘anthropogenic event’, ‘collapse’, ‘cavity collapse’, ‘mine collapse’, ‘building collapse’, ‘explosion’, ‘accidental explosion’, ‘chemical explosion’, ‘controlled explosion’, ‘experimental explosion’, ‘industrial explosion’, ‘mining explosion’, ‘quarry blast’, ‘road cut’, ‘blasting levee’, ‘nuclear explosion’, ‘induced or triggered event’, ‘rock burst’, ‘reservoir loading’, ‘fluid injection’, ‘fluid extraction’, ‘crash’, ‘plane crash’, ‘train crash’, ‘boat crash’, ‘other event’, ‘atmospheric event’, ‘sonic boom’, ‘sonic blast’, ‘acoustic noise’, ‘thunder’, ‘avalanche’, ‘snow avalanche’, ‘debris avalanche’, ‘hydroacoustic event’, ‘ice quake’, ‘slide’, ‘landslide’, ‘rockslide’, ‘meteorite’, ‘volcanic eruption’.
29 30 31 |
# File 'lib/ingv_quake/models/full_info_event.rb', line 29 def type @type end |