Class: Msewage::Importer::API

Inherits:
Object
  • Object
show all
Defined in:
lib/msewage-importer/api.rb

Instance Method Summary collapse

Constructor Details

#initialize(config = Config.new) ⇒ API

Returns a new instance of API.



6
7
8
# File 'lib/msewage-importer/api.rb', line 6

def initialize(config = Config.new)
  @config = config
end

Instance Method Details

#insert(record) ⇒ Object



10
11
12
13
14
# File 'lib/msewage-importer/api.rb', line 10

def insert(record)
  res = HTTParty.put(new_source_url, :body => new_source_body(record))
  !res["code"].nil?
  print "."
end