Sha256: 64908d5949ee9b37f1839217b1a1539d6c29070160202f1b9dbed39ee58389ce

Contents?: true

Size: 660 Bytes

Versions: 29

Compression:

Stored size: 660 Bytes

Contents

module Yao::Resources
  class Meter < Base
    friendly_attributes :meter_id, :name, :user_id, :resource_id, :project_id, :source, :type, :unit

    def id
      meter_id
    end

    def resource
      @resource ||= Yao::Resource.get(resource_id)
    end

    def tenant
      @tenant ||= Yao::Tenant.get(project_id)
    end

    def user
      @user ||= Yao::User.get(user_id)
    end

    self.service        = "metering"
    self.api_version    = "v2"
    self.resources_name = "meters"

    class << self
      private
      def resource_from_json(json)
        json
      end

      def resources_from_json(json)
        json
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
yao-0.7.0 lib/yao/resources/meter.rb
yao-0.6.3 lib/yao/resources/meter.rb
yao-0.6.2 lib/yao/resources/meter.rb
yao-0.6.1 lib/yao/resources/meter.rb
yao-0.6.0 lib/yao/resources/meter.rb
yao-0.5.0 lib/yao/resources/meter.rb
yao-0.4.3 lib/yao/resources/meter.rb
yao-0.4.2 lib/yao/resources/meter.rb
yao-0.4.1 lib/yao/resources/meter.rb
yao-0.4.0 lib/yao/resources/meter.rb
yao-0.3.8 lib/yao/resources/meter.rb
yao-0.3.7 lib/yao/resources/meter.rb
yao-0.3.6 lib/yao/resources/meter.rb
yao-0.3.5 lib/yao/resources/meter.rb
yao-0.3.4 lib/yao/resources/meter.rb
yao-0.3.3 lib/yao/resources/meter.rb
yao-0.3.2 lib/yao/resources/meter.rb
yao-0.3.1 lib/yao/resources/meter.rb
yao-0.3.0 lib/yao/resources/meter.rb
yao-0.2.13 lib/yao/resources/meter.rb