Class: EmailOctopus::List

Inherits:
Model
  • Object
show all
Defined in:
lib/email_octopus/list.rb

Overview

Mailing list.

Instance Attribute Summary

Attributes inherited from Model

#attributes

Instance Method Summary collapse

Methods inherited from Model

all, #as_json, attribute, create, #destroy, find, #initialize, method_missing, #persisted?, #reload!, #save, #to_json

Constructor Details

This class inherits a constructor from EmailOctopus::Model

Instance Method Details

#contactsObject


10
11
12
# File 'lib/email_octopus/list.rb', line 10

def contacts
  Contact.where list_id: id
end

#create_contact(params = {}) ⇒ Object


14
15
16
# File 'lib/email_octopus/list.rb', line 14

def create_contact(params = {})
  Contact.create params.merge(list_id: id)
end