Sha256: b8ca24ba34d7200df23a693ee25c7ff1b380cc6bbed718166f752fa0a3017428

Contents?: true

Size: 657 Bytes

Versions: 20

Compression:

Stored size: 657 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

      def logo
        if images.kind_of? Array
          images.find { |image| image.Type == "Logo" }
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
spark_api-1.4.28 lib/spark_api/models/account_report.rb
spark_api-1.4.27 lib/spark_api/models/account_report.rb
spark_api-1.4.26 lib/spark_api/models/account_report.rb
spark_api-1.4.25 lib/spark_api/models/account_report.rb
spark_api-1.4.24 lib/spark_api/models/account_report.rb
spark_api-1.4.23 lib/spark_api/models/account_report.rb
spark_api-1.4.22 lib/spark_api/models/account_report.rb
spark_api-1.4.21 lib/spark_api/models/account_report.rb
spark_api-1.4.20 lib/spark_api/models/account_report.rb
spark_api-1.4.19 lib/spark_api/models/account_report.rb
spark_api-1.4.18 lib/spark_api/models/account_report.rb
spark_api-1.4.17 lib/spark_api/models/account_report.rb
spark_api-1.4.16 lib/spark_api/models/account_report.rb
spark_api-1.4.15 lib/spark_api/models/account_report.rb
spark_api-1.4.14 lib/spark_api/models/account_report.rb
spark_api-1.4.13 lib/spark_api/models/account_report.rb
spark_api-1.4.12 lib/spark_api/models/account_report.rb
spark_api-1.4.11 lib/spark_api/models/account_report.rb
spark_api-1.4.10 lib/spark_api/models/account_report.rb
spark_api-1.4.9 lib/spark_api/models/account_report.rb