Sha256: 50470392f41ebf25c5feabc19cde99b887dbc9c99f4ccbceff2f6f29a992d9e3

Contents?: true

Size: 532 Bytes

Versions: 17

Compression:

Stored size: 532 Bytes

Contents

module SparkApi
  module Models
    class AccountReport < Account
      def self.report(account_id, arguments={})
        collect(connection.get("/accounts/#{account_id}/report", arguments)).first
      end

      def DisplayName
        self.Name
      end

      def primary_email
        if Array(emails).any? && emails.primary
          emails.primary.Address
        end
      end

      def primary_phone
        if Array(phones).any? && phones.primary
          phones.primary.Number
        end
      end

    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
spark_api-2.0.0 lib/spark_api/models/account_report.rb
spark_api-1.6.3 lib/spark_api/models/account_report.rb
spark_api-1.6.2 lib/spark_api/models/account_report.rb
spark_api-1.6.1 lib/spark_api/models/account_report.rb
spark_api-1.5.7 lib/spark_api/models/account_report.rb
spark_api-1.6.0 lib/spark_api/models/account_report.rb
spark_api-1.5.6 lib/spark_api/models/account_report.rb
spark_api-1.5.5 lib/spark_api/models/account_report.rb
spark_api-1.5.4 lib/spark_api/models/account_report.rb
spark_api-1.5.3 lib/spark_api/models/account_report.rb
spark_api-1.5.2 lib/spark_api/models/account_report.rb
spark_api-1.5.1 lib/spark_api/models/account_report.rb
spark_api-1.5.0 lib/spark_api/models/account_report.rb
spark_api-1.4.34 lib/spark_api/models/account_report.rb
spark_api-1.4.32 lib/spark_api/models/account_report.rb
spark_api-1.4.31 lib/spark_api/models/account_report.rb
spark_api-1.4.29 lib/spark_api/models/account_report.rb