Sha256: 7b788705e24e9368c45a654c0f086b957fa60beb0a00715ac46ef326c99dfa90

Contents?: true

Size: 623 Bytes

Versions: 3

Compression:

Stored size: 623 Bytes

Contents

module Yao::Resources
  class Meter < Base

    include TenantAssociationable

    friendly_attributes :meter_id, :name, :user_id, :resource_id, :source, :type, :unit

    def id
      meter_id
    end

    def resource
      @resource ||= Yao::Resource.get(resource_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)
        new(json)
      end

      def resources_from_json(json)
        new(json)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
yao-0.9.1 lib/yao/resources/meter.rb
yao-0.9.0 lib/yao/resources/meter.rb
yao-0.8.0 lib/yao/resources/meter.rb