lib/wasserstand/level.rb in wasserstand-0.0.8 vs lib/wasserstand/level.rb in wasserstand-0.0.9
- old
+ new
@@ -1,28 +1,16 @@
module Wasserstand
#
# see http://www.pegelonline.wsv.de/gast/hilfe#hilfe_pegelparameter
#
- class Level # Pegel
+ class Level
class << self
- def [](name)
- provider[name]
- end
+ include Finders
def all
- provider.all
+ Wasserstand.provider.levels
end
-
- def find_by_name(regex)
- provider.find_by_name(regex)
- end
-
- private
-
- def provider
- Wasserstand.providers[PegelOnline::LevelProvider]
- end
end
attr_reader :name
attr_accessor :level_id, :km, :measurements
attr_writer :waterway
@@ -40,8 +28,12 @@
end
end
def to_s
name
+ end
+
+ def inspect
+ "#<#{self.class.name}: #{name} (#{measurements.size} measurements)>"
end
end
end