Class: Gaah::ApiModel

Inherits:
Object
  • Object
show all
Defined in:
lib/gaah/api_model.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/gaah/api_model.rb', line 3

def id
  @id
end

Class Method Details

.batch_create(xml) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/gaah/api_model.rb', line 5

def self.batch_create(xml)
  if xml.is_a? Array
    xml.map(&method(:new))
  else
    (xml/:entry).map(&method(:new))
  end
end

Instance Method Details

#==(other) ⇒ Object



13
14
15
# File 'lib/gaah/api_model.rb', line 13

def ==(other)
  @id == other.id
end