Class: Wasserstand::Level
- Inherits:
-
Object
- Object
- Wasserstand::Level
- 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.
- #to_s ⇒ Object
Constructor Details
#initialize(name) ⇒ Level
Returns a new instance of Level.
30 31 32 33 |
# File 'lib/wasserstand/level.rb', line 30 def initialize(name) @name = name @measurements = [] end |
Instance Attribute Details
#km ⇒ Object
Returns the value of attribute km.
27 28 29 |
# File 'lib/wasserstand/level.rb', line 27 def km @km end |
#level_id ⇒ Object
Returns the value of attribute level_id.
27 28 29 |
# File 'lib/wasserstand/level.rb', line 27 def level_id @level_id end |
#measurements ⇒ Object
Returns the value of attribute measurements.
27 28 29 |
# File 'lib/wasserstand/level.rb', line 27 def measurements @measurements end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
26 27 28 |
# File 'lib/wasserstand/level.rb', line 26 def name @name end |
#waterway ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/wasserstand/level.rb', line 35 def waterway if @waterway.respond_to?(:name) @waterway else @waterway = Waterway[@waterway] end end |
Class Method Details
.[](name) ⇒ Object
7 8 9 |
# File 'lib/wasserstand/level.rb', line 7 def [](name) provider[name] end |
.all ⇒ Object
11 12 13 |
# File 'lib/wasserstand/level.rb', line 11 def all provider.all end |
.find_by_name(regex) ⇒ Object
15 16 17 |
# File 'lib/wasserstand/level.rb', line 15 def find_by_name(regex) provider.find_by_name(regex) end |
Instance Method Details
#to_s ⇒ Object
43 44 45 |
# File 'lib/wasserstand/level.rb', line 43 def to_s name end |