Sha256: 153a1a8421350811b99a316354a49419cc57aefd1082f75bea72d37fd24a53ac

Contents?: true

Size: 1.25 KB

Versions: 10

Compression:

Stored size: 1.25 KB

Contents

module ChurchCommunityBuilder

  class UserWriter < ApiWriter

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

      @url_data_params = data

      @updatable_fields = [:title,
                           :first,
                           :middle,
                           :last,
                           :nickname,
                           :gender,
                           :email,
                           :staff,
                           :primary_campus_id,
                           :member_since,
                           :birthdate,
                           :primary_phone,
                           :primary_phone_type,
                           :secondary_phone,
                           :secondary_phone_type,
                           :external_id_1,
                           :external_id_2,
                           :external_id_3,
                           :marital_status,
                           :is_an_organization]      
    end
    
  end

end


Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
church-community-builder-0.2.2 lib/writers/user_writer.rb
church-community-builder-0.2.1 lib/writers/user_writer.rb
church-community-builder-0.2.0 lib/writers/user_writer.rb
church-community-builder-0.1.6 lib/writers/user_writer.rb
church-community-builder-0.1.5 lib/writers/user_writer.rb
church-community-builder-0.1.4 lib/writers/user_writer.rb
church-community-builder-0.1.3 lib/writers/user_writer.rb
church-community-builder-0.1.2 lib/writers/user_writer.rb
church-community-builder-0.1.1 lib/writers/user_writer.rb
church-community-builder-0.1.0 lib/writers/user_writer.rb