Class: Legistar::Action
- Inherits:
-
Object
- Object
- Legistar::Action
- Includes:
- HTTParty
- Defined in:
- lib/legistar/action.rb
Instance Method Summary collapse
- #create(options = {}) ⇒ Object
- #destroy(id) ⇒ Object
- #get(id) ⇒ Object
-
#index ⇒ Object
Example Response.
-
#initialize(host:) ⇒ Action
constructor
A new instance of Action.
- #update(id, options = {}) ⇒ Object
Constructor Details
#initialize(host:) ⇒ Action
Returns a new instance of Action.
6 7 8 |
# File 'lib/legistar/action.rb', line 6 def initialize(host:) @host = host end |
Instance Method Details
#create(options = {}) ⇒ Object
32 33 34 |
# File 'lib/legistar/action.rb', line 32 def create( = {}) response = self.class.post("/v1/#{@host}/Actions/", ) end |
#destroy(id) ⇒ Object
40 41 42 |
# File 'lib/legistar/action.rb', line 40 def destroy(id) response = self.class.delete("/v1/#{@host}/Actions/#{id}") end |
#get(id) ⇒ Object
27 28 29 30 |
# File 'lib/legistar/action.rb', line 27 def get(id) response = self.class.get("/v1/#{@host}/Actions/#{id}") response.to_h end |
#index ⇒ Object
Example Response
"ActionId"=>367,
"ActionGuid"=>nil,
"ActionLastModifiedUtc"=>"2014-05-24T04:15:17.893",
"ActionRowVersion"=>"AAAAAAAeM4E=",
"ActionName"=>"Adopted As Amended",
"ActionActiveFlag"=>1,
"ActionUsedFlag"=>0
22 23 24 25 |
# File 'lib/legistar/action.rb', line 22 def index response = self.class.get("/v1/#{@host}/Actions") actions = response.to_a end |
#update(id, options = {}) ⇒ Object
36 37 38 |
# File 'lib/legistar/action.rb', line 36 def update(id, = {}) response = self.class.put("/v1/#{@host}/Actions/#{id}", ) end |