Sha256: dc523786e8d3d89b780d74c17e72a13fc86d5d9d17c68245f456a10b327c4464

Contents?: true

Size: 671 Bytes

Versions: 1

Compression:

Stored size: 671 Bytes

Contents

require 'kegbot_api/nouns/remote_rest_noun'

module KegbotApi
  class Session < RemoteRestNoun
    id      :id
    string  :name
    time    :start_time
    time    :end_time
    boolean :active, :attribute_name => 'is_active'
    float   :volume_ml

    def self.all
      list(get("#{self.client.base_url}/sessions"))
    end

    def self.find(id, *args)
      one(get("#{self.client.base_url}/sessions/#{id}"))
    end

    def to_s
      "#<#{self.class.to_s}:#{"0x%x" % object_id} @id=#{self.id.inspect}>"
    end

    def self.to_s
      self.client ? "KegbotApi::Session<#{self.client.base_url}>" : super
    end

    def self.inspect
      to_s
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kegbot_api-0.0.1 lib/kegbot_api/nouns/session.rb