Class: Ushahidi::Report

Inherits:
Doodle
  • Object
show all
Defined in:
lib/ushahidi.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.approve(id) ⇒ Object



42
43
44
45
46
47
48
49
50
51
# File 'lib/ushahidi.rb', line 42

def self.approve(id)
  raise "No api base" unless Ushahidi.api_base

  res = RestClient.post(Ushahidi.api_base, {
      :task => "reports",
      :incident_id => id.to_s,
      :action => "approve"
    })
  return JSON.parse(res)
end

Instance Method Details

#to_params_hashObject



34
35
36
37
38
39
40
# File 'lib/ushahidi.rb', line 34

def to_params_hash
  incident.to_params_hash.merge(
    "location_name" => "#{location_name}",
    "longitude"     => "#{longitude}",
    "latitude"      => "#{latitude}"
    )
end