Module: Jirafe::Model::ClassMethods

Defined in:
lib/jirafe/model.rb

Instance Method Summary collapse

Instance Method Details

#attributes(attrs = {}) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/jirafe/model.rb', line 13

def attributes(attrs = {})
  return @attributes if @attributes && attrs === {}
  attrs.each_pair do |attr_name, options|
    attr_accessor attr_name
    define_identifier(attr_name) if options.include?(:identifier)
  end
  @attributes ||= attrs
end

#create(*args) ⇒ Object



26
27
28
# File 'lib/jirafe/model.rb', line 26

def create(*args)
  raise "Not implemented"
end

#handle_response(resource, response) ⇒ Object



34
35
36
37
# File 'lib/jirafe/model.rb', line 34

def handle_response(resource, response)
  check_response_for_exception(response)
  resource.reinitialize(response.parsed_response)
end

#loggerObject



9
10
11
# File 'lib/jirafe/model.rb', line 9

def logger
  Jirafe.config.logger
end

#retrieve(*args) ⇒ Object



22
23
24
# File 'lib/jirafe/model.rb', line 22

def retrieve(*args)
  raise "Not implemented"
end

#update(*args) ⇒ Object



30
31
32
# File 'lib/jirafe/model.rb', line 30

def update(*args)
  raise "Not implemented"
end