Sha256: 59dc175a9143048fc390ac72b0db7f95b6aea14def7f3b1b459a19ff26d4aa82

Contents?: true

Size: 493 Bytes

Versions: 18

Compression:

Stored size: 493 Bytes

Contents

require_relative 'api/resource_collection'
require_relative 'email_address'

class ContextIO
  class EmailAddressCollection
    include ContextIO::API::ResourceCollection

    self.resource_class = ContextIO::EmailAddress
    self.association_name = :email_addresses

    belongs_to :account

    def create(address)
      result_hash = api.request(:post, resource_url, email_address: address)

      result_hash.delete('success')

      resource_class.new(api, result_hash)
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
contextio-2.0.0 lib/contextio/email_address_collection.rb
contextio-1.8.1 lib/contextio/email_address_collection.rb
contextio-1.8.0 lib/contextio/email_address_collection.rb
contextio-1.7.2 lib/contextio/email_address_collection.rb
contextio-1.7.1 lib/contextio/email_address_collection.rb
contextio-1.7.0 lib/contextio/email_address_collection.rb
contextio-1.6.0 lib/contextio/email_address_collection.rb
contextio-1.5.0 lib/contextio/email_address_collection.rb
contextio-1.4.0 lib/contextio/email_address_collection.rb
contextio-1.3.0 lib/contextio/email_address_collection.rb
contextio-1.2.4 lib/contextio/email_address_collection.rb
contextio-1.2.3 lib/contextio/email_address_collection.rb
contextio-1.2.2 lib/contextio/email_address_collection.rb
contextio-1.2.1 lib/contextio/email_address_collection.rb
contextio-1.2.0 lib/contextio/email_address_collection.rb
contextio-1.1.0 lib/contextio/email_address_collection.rb
contextio-1.0.1 lib/contextio/email_address_collection.rb
contextio-1.0.0 lib/contextio/email_address_collection.rb