Class: Gerint::Padrao

Inherits:
Object
  • Object
show all
Defined in:
lib/gerint/servicos/padrao.rb

Instance Method Summary collapse

Instance Method Details

#obj_to_hash(object = self, hash = {}) ⇒ Object



8
9
10
11
12
13
# File 'lib/gerint/servicos/padrao.rb', line 8

def obj_to_hash(object = self, hash = {})
    object.each_pair do |key, value|
        hash[key] = value
    end
    hash
end

#obj_to_json(object = self) ⇒ Object



15
16
17
# File 'lib/gerint/servicos/padrao.rb', line 15

def obj_to_json(object = self)
    self.obj_to_hash(object).to_json
end