Class: Wasserstand::Level
- Inherits:
-
Object
- Object
- Wasserstand::Level
- Extended by:
- Finders
- Defined in:
- lib/wasserstand/level.rb
Overview
Instance Attribute Summary collapse
-
#km ⇒ Object
Returns the value of attribute km.
-
#level_id ⇒ Object
Returns the value of attribute level_id.
-
#measurements ⇒ Object
Returns the value of attribute measurements.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
- #waterway ⇒ Object
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name) ⇒ Level
constructor
A new instance of Level.
- #inspect ⇒ Object
- #to_s ⇒ Object
Methods included from Finders
Constructor Details
#initialize(name) ⇒ Level
Returns a new instance of Level.
18 19 20 21 |
# File 'lib/wasserstand/level.rb', line 18 def initialize(name) @name = name @measurements = [] end |
Instance Attribute Details
#km ⇒ Object
Returns the value of attribute km.
15 16 17 |
# File 'lib/wasserstand/level.rb', line 15 def km @km end |
#level_id ⇒ Object
Returns the value of attribute level_id.
15 16 17 |
# File 'lib/wasserstand/level.rb', line 15 def level_id @level_id end |
#measurements ⇒ Object
Returns the value of attribute measurements.
15 16 17 |
# File 'lib/wasserstand/level.rb', line 15 def measurements @measurements end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
14 15 16 |
# File 'lib/wasserstand/level.rb', line 14 def name @name end |
#waterway ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/wasserstand/level.rb', line 23 def waterway if @waterway.respond_to?(:name) @waterway else @waterway = Waterway[@waterway] end end |
Class Method Details
.all ⇒ Object
9 10 11 |
# File 'lib/wasserstand/level.rb', line 9 def all Wasserstand.provider.levels end |
Instance Method Details
#inspect ⇒ Object
35 36 37 |
# File 'lib/wasserstand/level.rb', line 35 def inspect "#<#{self.class.name}: #{name} (#{measurements.size} measurements)>" end |
#to_s ⇒ Object
31 32 33 |
# File 'lib/wasserstand/level.rb', line 31 def to_s name end |