Class: Foto::Consumer

Inherits:
Object
  • Object
show all
Defined in:
lib/foto/consumer.rb

Direct Known Subclasses

Patient

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Consumer

Returns a new instance of Consumer.



9
10
11
12
13
# File 'lib/foto/consumer.rb', line 9

def initialize(attributes={})
  attributes.each do |k, v|
    send("#{k}=", v)
  end
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



3
4
5
# File 'lib/foto/consumer.rb', line 3

def api_key
  @api_key
end

Class Method Details

.urlObject

Raises:

  • (NotImplementedError)


5
6
7
# File 'lib/foto/consumer.rb', line 5

def self.url
  raise NotImplementedError.new('You must implement self.url')
end

Instance Method Details

#as_jsonObject

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/foto/consumer.rb', line 15

def as_json
  raise NotImplementedError.new('You must implement as_json')
end

#saveObject



19
20
21
22
# File 'lib/foto/consumer.rb', line 19

def save
  put = Foto::Requests::Put.new(self, as_json)
  put.run
end