Module: SparkApi::Primary

Included in:
Models::Account::Address, Models::Account::Email, Models::Account::Phone, Models::Account::Website
Defined in:
lib/spark_api/primary_array.rb

Overview

Primary: interface to implement for elements that are added to a “PrimaryArray” collection

Instance Method Summary collapse

Instance Method Details

#primary?Boolean

Return true if the element is the primary resource in a collection. Default implementation looks for a “Primary” attribute

Returns:

  • (Boolean)


25
26
27
# File 'lib/spark_api/primary_array.rb', line 25

def primary?
  @attributes.key?("Primary") && self.Primary == true
end