Class: NcsNavigator::Configuration::SecondarySamplingUnit
- Inherits:
-
Struct
- Object
- Struct
- NcsNavigator::Configuration::SecondarySamplingUnit
- Defined in:
- lib/ncs_navigator/configuration/sampling_units.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#sampling_unit_area ⇒ Object
(also: #area)
Returns the value of attribute sampling_unit_area.
Instance Method Summary collapse
-
#initialize ⇒ SecondarySamplingUnit
constructor
A new instance of SecondarySamplingUnit.
-
#primary_sampling_unit ⇒ PrimarySamplingUnit
(also: #psu)
The PSU to which this SSU belongs.
-
#tertiary_sampling_units ⇒ TertiarySamplingUnit
(also: #tsus)
Any TSUs defined for this SSU.
Constructor Details
#initialize ⇒ SecondarySamplingUnit
Returns a new instance of SecondarySamplingUnit.
41 42 43 44 |
# File 'lib/ncs_navigator/configuration/sampling_units.rb', line 41 def initialize(*) super sampling_unit_area.secondary_sampling_units << self end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id
40 41 42 |
# File 'lib/ncs_navigator/configuration/sampling_units.rb', line 40 def id @id end |
#name ⇒ Object
Returns the value of attribute name
40 41 42 |
# File 'lib/ncs_navigator/configuration/sampling_units.rb', line 40 def name @name end |
#sampling_unit_area ⇒ Object Also known as: area
Returns the value of attribute sampling_unit_area
40 41 42 |
# File 'lib/ncs_navigator/configuration/sampling_units.rb', line 40 def sampling_unit_area @sampling_unit_area end |
Instance Method Details
#primary_sampling_unit ⇒ PrimarySamplingUnit Also known as: psu
Returns the PSU to which this SSU belongs.
48 49 50 |
# File 'lib/ncs_navigator/configuration/sampling_units.rb', line 48 def primary_sampling_unit area.psu end |
#tertiary_sampling_units ⇒ TertiarySamplingUnit Also known as: tsus
Returns any TSUs defined for this SSU.
54 55 56 |
# File 'lib/ncs_navigator/configuration/sampling_units.rb', line 54 def tertiary_sampling_units @tertiary_sampling_units ||= [] end |