Sha256: c3221cba4bbb68740cbbb74d4b9c7ac58b6c2e84d5c064e19db6b2b657804bc9

Contents?: true

Size: 1.09 KB

Versions: 8

Compression:

Stored size: 1.09 KB

Contents

#
# account_info.rb
# ConstantContact
#
# Copyright (c) 2013 Constant Contact. All rights reserved.

module ConstantContact
  module Components
    class AccountInfo < Component
      attr_accessor :website, :organization_name, :first_name, :last_name, :email, :phone, :country_code, :state_code,
                    :company_logo, :time_zone, :organization_addresses

      # Class constructor
      # @return [AccountInfo]
      def initialize
      end

      # Factory method to create an AccountInfo object from a json string
      # @param [Hash] props - properties to create object from
      # @return [AccountInfo]
      def self.create(props)
        obj = AccountInfo.new
        if props
          props.each do |key, value|
            key = key.to_s
            if key == 'organization_addresses'
              value = value || []
              obj.organization_addresses = value.collect{|address| Components::AccountAddress.create(address) }
            else
              obj.send("#{key}=", value) if obj.respond_to? key
            end
          end
        end
        obj
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
constantcontact-4.0.0 lib/constantcontact/components/account/account_info.rb
constantcontact-3.0.0 lib/constantcontact/components/account/account_info.rb
constantcontact-2.2.1 lib/constantcontact/components/account/account_info.rb
constantcontact-ruby-2.2.1 lib/constantcontact/components/account/account_info.rb
constantcontact-ruby-2.2.0 lib/constantcontact/components/account/account_info.rb
constantcontact-2.2.0 lib/constantcontact/components/account/account_info.rb
constantcontact-2.1.0 lib/constantcontact/components/account/account_info.rb
constantcontact-2.0.1 lib/constantcontact/components/account/account_info.rb