Class: Evrythng::Client

Inherits:
Object
  • Object
show all
Includes:
Collections, Properties, Search, Thngs, Connection, Request
Defined in:
lib/evrythng/client.rb,
lib/evrythng/client/thngs.rb,
lib/evrythng/client/search.rb,
lib/evrythng/client/properties.rb,
lib/evrythng/client/collections.rb

Overview

Wrapper for the Evrythng REST API

Defined Under Namespace

Modules: Collections, Properties, Search, Thngs

Instance Method Summary collapse

Methods included from Search

#search

Methods included from Properties

#properties, #property, #property_create, #property_update

Methods included from Collections

#collection_create, #collections

Methods included from Thngs

#thng, #thng_create, #thng_update, #thngs

Methods included from Request

#delete, #get, #post, #put

Constructor Details

#initialize(attrs = {}) ⇒ Evrythng::Client

Initializes a new API object

Parameters:

  • attrs (Hash) (defaults to: {})


29
30
31
32
33
34
# File 'lib/evrythng/client.rb', line 29

def initialize(attrs={})
  attrs = Evrythng.options.merge(attrs)
  Config::VALID_OPTIONS_KEYS.each do |key|
    instance_variable_set("@#{key}".to_sym, attrs[key])
  end
end