Sha256: e3268f9cd9efc2576edb32c393cdbe3a7cf0d76311565068d06d8eeb9c4f69ed

Contents?: true

Size: 872 Bytes

Versions: 2

Compression:

Stored size: 872 Bytes

Contents

module Mashery
  class Service < RpcClient::Base
    attribute :service_key,  String
    attribute :name,         String
    attribute :limits,       Hash
    attribute :created,      DateTime
    attribute :updated,      DateTime
    attribute :object_type,  String

    def inspect
      "<Mashery::Service service_key=#{service_key.inspect}>"
    end

    def activity(options = {})
      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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mashery_rails-0.6.9.pre4 lib/mashery/service.rb
mashery_rails-0.6.9.pre3 lib/mashery/service.rb