lib/mashery/service.rb in mashery_rails-0.6.7 vs lib/mashery/service.rb in mashery_rails-0.6.8
- old
+ new
@@ -1,9 +1,24 @@
module Mashery
class Service < RpcClient::Base
- attr_accessor :service_key, :name, :limits, :created, :updated, :object_type
+ attribute :service_key, String
+ attribute :name, String
+ attribute :limits, Hash
+ attribute :created, DateTime
+ attribute :updated, DateTime
+ attribute :object_type, String
def activity(options = {})
- Mashery.rest.activity("developer_activity", service_key, start_date: 1.day.ago, end_date: 0.days.ago)
+ Mashery.rest.call("developer_activity", service_key, {
+ # TODO: For API purposes, these values probably shouldn't be hard-coded
+ start_date: 1.day.ago, end_date: 0.days.ago
+ }.merge(options))
+ end
+
+ def errorcodes(options = {})
+ Mashery.rest.call("errorcodes", service_key, {
+ # TODO: For API purposes, these values probably shouldn't be hard-coded
+ start_date: 1.day.ago, end_date: 0.days.ago
+ }.merge(options))
end
end
end