Module: Camdram::API

Included in:
Client, Diary, Event, Image, News, Organisation, Performance, Person, Search, Show, User, Venue
Defined in:
lib/camdram/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#httpObject

Returns the value of attribute http.



6
7
8
# File 'lib/camdram/api.rb', line 6

def http
  @http
end

Instance Method Details

#initialize(options = {}) ⇒ Object

Instantiate a new object

Parameters:

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

    A single JSON hash with symbolized keys.

Returns:

  • (Object)

    The newly instantiated object.



12
13
14
# File 'lib/camdram/api.rb', line 12

def initialize(options = {})
  super(options)
end

#update!Object

Note:

The object this method is called on is updated 'in place'.

Update the object

Returns:

  • (Object)

    The object the method is called on.



20
21
22
23
24
# File 'lib/camdram/api.rb', line 20

def update!
  json = get(self.url_slug)
  self.send(:initialize, json)
  return self
end