Class: ActiveCollab::Categorie

Inherits:
Object
  • Object
show all
Defined in:
lib/active_collab/categorie.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#idObject

Returns the value of attribute id.



2
3
4
# File 'lib/active_collab/categorie.rb', line 2

def id
  @id
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/active_collab/categorie.rb', line 2

def name
  @name
end

Class Method Details

.from_hash(hash) ⇒ Object



4
5
6
7
8
9
# File 'lib/active_collab/categorie.rb', line 4

def self.from_hash(hash)
  categorie = ActiveCollab::Categorie.new
  categorie.id = hash["id"].to_i
  categorie.name = hash["name"]
  categorie
end