Sha256: fe9b094a91b0dd8a802f9f51ff51f4dd54d24f2098bd4b6c35cefbd0a926b4a1

Contents?: true

Size: 754 Bytes

Versions: 13

Compression:

Stored size: 754 Bytes

Contents

# frozen_string_literal: true

module AutotaskRuby
  # Represents the Autotask Entity Resource
  class Resource
    include AutotaskRuby::Entity
    include AutotaskRuby::Query

    FIELDS = %i[id Email Email2 Email3 FirstName HomePhone Initials LastName LocationID MiddleName
                MobilePhone OfficeExtension OfficePhone ResourceType Title UserName UserType Active].freeze
             .each do |field|
      attr_accessor :"#{field.to_s.underscore}"
    end

    def post_initialize
      has_many :account_to_dos, foreign_key: 'AssignedToResourceID'
      has_many :appointments, foreign_key: 'ResourceID'
      has_many :tickets, foreign_key: 'AssignedResourceID'
      has_many :tasks, foreign_key: 'AssignedResourceID'
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
autotask_ruby-2.4.2 lib/autotask_ruby/resource.rb
autotask_ruby-2.4.1 lib/autotask_ruby/resource.rb
autotask_ruby-2.4.0 lib/autotask_ruby/resource.rb
autotask_ruby-2.3.2 lib/autotask_ruby/resource.rb
autotask_ruby-2.3.1 lib/autotask_ruby/resource.rb
autotask_ruby-2.3.0 lib/autotask_ruby/resource.rb
autotask_ruby-2.2.0 lib/autotask_ruby/resource.rb
autotask_ruby-2.1.3 lib/autotask_ruby/resource.rb
autotask_ruby-2.1.2 lib/autotask_ruby/resource.rb
autotask_ruby-2.1.1 lib/autotask_ruby/resource.rb
autotask_ruby-2.1.0 lib/autotask_ruby/resource.rb
autotask_ruby-2.0.1 lib/autotask_ruby/resource.rb
autotask_ruby-2.0.0 lib/autotask_ruby/resource.rb