class Legistar::Action

Public Class Methods

new(host:) click to toggle source
# File lib/legistar/action.rb, line 6
def initialize(host:)
  @host = host
end

Public Instance Methods

create(options = {}) click to toggle source
# File lib/legistar/action.rb, line 32
def create(options = {})
  response = self.class.post("/v1/#{@host}/Actions/", options)
end
destroy(id) click to toggle source
# File lib/legistar/action.rb, line 40
def destroy(id)
  response = self.class.delete("/v1/#{@host}/Actions/#{id}")
end
get(id) click to toggle source
# File lib/legistar/action.rb, line 27
def get(id)
  response = self.class.get("/v1/#{@host}/Actions/#{id}")
  response.to_h
end
index() click to toggle source

Example Response

{

"ActionId"=>367,
"ActionGuid"=>nil,
"ActionLastModifiedUtc"=>"2014-05-24T04:15:17.893",
"ActionRowVersion"=>"AAAAAAAeM4E=",
"ActionName"=>"Adopted As Amended",
"ActionActiveFlag"=>1,
"ActionUsedFlag"=>0

}

# File lib/legistar/action.rb, line 22
def index
  response = self.class.get("/v1/#{@host}/Actions")
  actions = response.to_a
end
update(id, options = {}) click to toggle source
# File lib/legistar/action.rb, line 36
def update(id, options = {})
  response = self.class.put("/v1/#{@host}/Actions/#{id}", options)
end