Sha256: 1fb09d7e2496b8283751e2aa3ac5c41902f5cc904b73b797664023650ad0a8fe

Contents?: true

Size: 574 Bytes

Versions: 10

Compression:

Stored size: 574 Bytes

Contents

module Access
  class Device

    def self.process_batch(chunk)
      chunk.map { |device| new(device) }
    end

    def initialize(values)
      self.class.class_eval {attr_reader *values.keys }
      values.each do |attribute_name, attribute_value|
        self.instance_variable_set("@#{attribute_name}", attribute_value)
      end
    end

    def self.search(member_key, options = {})
      Access::Api.new.search_devices member_key, options
    end

    def self.find(member_key, options = {})
      Access::Api.new.find_device member_key, options
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
access-2.0.50 lib/access/device.rb
access-2.0.49 lib/access/device.rb
access-2.0.48 lib/access/device.rb
access-2.0.47 lib/access/device.rb
access-2.0.46 lib/access/device.rb
access-2.0.44 lib/access/device.rb
access-2.0.43 lib/access/device.rb
access-2.0.42 lib/access/device.rb
access-2.0.41 lib/access/device.rb
access-2.0.40 lib/access/device.rb