Sha256: 962e942f8dc77ad9defead382417f3a11dbbf3b8320b55b7c464e1e075de8334

Contents?: true

Size: 726 Bytes

Versions: 26

Compression:

Stored size: 726 Bytes

Contents

module TheCity

  class UserAddressWriter < ApiWriter

    # Constructor.
    #
    # @param data The json object data to save.
    def initialize(data)
      if data[:id] 
        @url_action = :put
        @url_data_path = "/users/#{data[:user_id]}/addresses/#{data[:id]}"   
      else
        @url_action = :post   
        @url_data_path = "/users/#{data[:user_id]}/addresses"   
      end
      @url_data_delete_path = "/users/#{data[:user_id]}/addresses/#{data[:id]}" 

      @url_data_params = data


      @updatable_fields = [:city,
                           :zipcode,
                           :street,
                           :location_type,
                           :state]      
    end
    
  end

end


Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
the-city-admin-0.7.1 lib/writers/user_address_writer.rb
the-city-admin-0.7.0 lib/writers/user_address_writer.rb
the-city-admin-0.6.9 lib/writers/user_address_writer.rb
the-city-admin-0.6.8 lib/writers/user_address_writer.rb
the-city-admin-0.6.7 lib/writers/user_address_writer.rb
the-city-admin-0.6.6 lib/writers/user_address_writer.rb
the-city-admin-0.6.5 lib/writers/user_address_writer.rb
the-city-admin-0.6.4 lib/writers/user_address_writer.rb
the-city-admin-0.6.3 lib/writers/user_address_writer.rb
the-city-admin-0.6.2 lib/writers/user_address_writer.rb
the-city-admin-0.6.1 lib/writers/user_address_writer.rb
the-city-admin-0.6.0 lib/writers/user_address_writer.rb
the-city-admin-0.5.2 lib/writers/user_address_writer.rb
the-city-admin-0.5.1 lib/writers/user_address_writer.rb
the-city-admin-0.5.0 lib/writers/user_address_writer.rb
the-city-admin-0.4.0 lib/writers/user_address_writer.rb
the-city-admin-0.3.1 lib/writers/user_address_writer.rb
the-city-admin-0.3.0 lib/writers/user_address_writer.rb
the-city-admin-0.2.1 lib/writers/user_address_writer.rb
the-city-admin-0.2.0 lib/writers/user_address_writer.rb