lib/zelda/zender.rb in bartzon-zelda-0.0.1 vs lib/zelda/zender.rb in bartzon-zelda-0.0.2
- old
+ new
@@ -1,13 +1,25 @@
-class Zelda::Zender < Zelda::Object
- def self.url(code=false)
- code ? "zenders/#{code}" : "zenders"
- end
-
- def name
- @attrs["zender"]["name"]
- end
+module Zelda
+ class Zender
+ class << self
+ def find(id)
+ new Request.get("zenders/#{id}")
+ end
+
+ def all
+ Request.get("zenders")
+ end
+ end
+
+ def initialize(attrs={})
+ @attrs = attrs
+ end
+
+ def name
+ @attrs["zender"]["name"]
+ end
- def code
- @attrs["zender"]["code"]
+ def code
+ @attrs["zender"]["code"]
+ end
end
-end
+end
\ No newline at end of file