class Legistar::BodyType
Public Class Methods
new(host:)
click to toggle source
# File lib/legistar/body_type.rb, line 6 def initialize(host:) @host = host end
Public Instance Methods
create(options = {})
click to toggle source
# File lib/legistar/body_type.rb, line 29 def create(options = {}) response = self.class.post("/v1/#{@host}/BodyTypes/", options) end
destroy(id)
click to toggle source
# File lib/legistar/body_type.rb, line 37 def destroy(id) response = self.class.delete("/v1/#{@host}/BodyTypes/#{id}") end
get(id)
click to toggle source
# File lib/legistar/body_type.rb, line 24 def get(id) response = self.class.get("/v1/#{@host}/BodyTypes/#{id}") response.to_h end
index()
click to toggle source
Example Response
{ “BodyTypeId”=>42, “BodyTypeGuid”=>“B3C517AA-98B9-44BF-A3DE-7B9E8B4ACB5A”, “BodyTypeLastModifiedUtc”=>“2014-05-24T04:15:18.647”, “BodyTypeRowVersion”=>“AAAAAAA0AeY=”, “BodyTypeName”=>“City Council” }
# File lib/legistar/body_type.rb, line 19 def index response = self.class.get("/v1/#{@host}/BodyTypes") actions = response.to_a end
update(id, options = {})
click to toggle source
# File lib/legistar/body_type.rb, line 33 def update(id, options = {}) response = self.class.put("/v1/#{@host}/BodyTypes/#{id}", options) end