Class: Epok::Object

Inherits:
Object
  • Object
show all
Defined in:
lib/epok/object.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ Object

Returns a new instance of Object.



5
6
7
# File 'lib/epok/object.rb', line 5

def initialize(id)
  @id = id
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/epok/object.rb', line 3

def id
  @id
end

Instance Method Details

#contentObject



17
18
19
20
21
22
# File 'lib/epok/object.rb', line 17

def content
  object["contenido"].each_with_object({}) do |entry, hash|
    name, value = entry.values_at("nombre", "valor")
    hash[name] = value unless value.empty?
  end
end

#nameObject



9
10
11
# File 'lib/epok/object.rb', line 9

def name
  content["Nombre"]
end

#normalized_addressObject



13
14
15
# File 'lib/epok/object.rb', line 13

def normalized_address
  object["direccionNormalizada"]
end