Class: TheCity::GroupAddressWriter
- Defined in:
- lib/writers/group_address_writer.rb
Instance Attribute Summary
Attributes inherited from ApiWriter
#error_messages, #response_code
Instance Method Summary collapse
-
#initialize(data) ⇒ GroupAddressWriter
constructor
Constructor.
Methods inherited from ApiWriter
Constructor Details
#initialize(data) ⇒ GroupAddressWriter
Constructor.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/writers/group_address_writer.rb', line 8 def initialize(data) if data[:id] @url_action = :put @url_data_path = "/groups/#{data[:group_id]}/addresses/#{data[:id]}" else @url_action = :post @url_data_path = "/groups/#{data[:group_id]}/addresses" end @url_data_delete_path = "/groups/#{data[:group_id]}/addresses/#{data[:id]}" @url_data_params = data @updatable_fields = [:city, :zipcode, :street, :location_type, :state] end |