Class: Copa::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/copa/action.rb

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ Action

Returns a new instance of Action.



3
4
5
6
# File 'lib/copa/action.rb', line 3

def initialize(id)
  @id = id
  @data = ::Nokogiri::HTML ::RestClient.get(url) # TODO: test it
end

Instance Method Details

#cityObject



28
29
30
# File 'lib/copa/action.rb', line 28

def city
#      field "#parent-fieldname-municipio"
end

#justificationObject



16
17
18
# File 'lib/copa/action.rb', line 16

def justification
  field("#parent-fieldname-justificativa")
end

#priceObject



20
21
22
# File 'lib/copa/action.rb', line 20

def price
  field("#parent-fieldname-custo_estimado_por_lote")
end

#stateObject



24
25
26
# File 'lib/copa/action.rb', line 24

def state
  field "#parent-fieldname-uf"
end

#typeObject



12
13
14
# File 'lib/copa/action.rb', line 12

def type
  field("#parent-fieldname-tipo")
end

#urlObject



8
9
10
# File 'lib/copa/action.rb', line 8

def url
  "#{URL_BASE}/acoes/#{@id}"
end