Sha256: e5e259471a904b86d884bd089c17030f4946adb2b05b7affbae8b096dce2a5b9

Contents?: true

Size: 1.65 KB

Versions: 3

Compression:

Stored size: 1.65 KB

Contents

class Feed
  extend Xively::Base

  is_xively :feed
  attr_accessor :datastreams
  attr_accessor :feed
  attr_accessor :creator
  attr_accessor :title
  attr_accessor :website
  attr_accessor :icon
  attr_accessor :description
  attr_accessor :updated
  attr_accessor :email
  attr_accessor :private
  attr_accessor :tags
  attr_accessor :location_disposition
  attr_accessor :location_domain
  attr_accessor :location_ele
  attr_accessor :location_exposure
  attr_accessor :location_lat
  attr_accessor :location_lon
  attr_accessor :location_name

  def attributes
    attributes = {}
    Xively::Feed::ALLOWED_KEYS.each do |key|
      attributes[key] = self.send(key) if self.respond_to?(key)
    end
    attributes
  end
end

class Datastream
  extend Xively::Base

  is_xively :datastream, {:id => :stream_id}

  attr_accessor :feed
  attr_accessor :feed_id
  attr_accessor :datapoints
  attr_accessor :id
  attr_accessor :stream_id
  attr_accessor :feed_creator
  attr_accessor :current_value
  attr_accessor :min_value
  attr_accessor :max_value
  attr_accessor :unit_label
  attr_accessor :unit_type
  attr_accessor :unit_symbol
  attr_accessor :tags
  attr_accessor :updated

  def attributes
    attributes = {}
    Xively::Datastream::ALLOWED_KEYS.each do |key|
      attributes[key] = self.send(key) if self.respond_to?(key)
    end
    attributes
  end

end

class Datapoint
  extend Xively::Base

  is_xively :datapoint
  attr_accessor :datastream_id
  attr_accessor :at
  attr_accessor :value

  def attributes
    attributes = {}
    Xively::Datapoint::ALLOWED_KEYS.each do |key|
      attributes[key] = self.send(key) if self.respond_to?(key)
    end
    attributes
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
xively-rb-connector-0.1.4 spec/support/fixtures/models.rb
xively-rb-connector-0.1.3 spec/support/fixtures/models.rb
xively-rb-connector-0.1.2 spec/support/fixtures/models.rb