Class: Jung::List

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

Direct Known Subclasses

Campaign

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ List

Returns a new instance of List.



7
8
9
10
11
12
# File 'lib/jung/list.rb', line 7

def initialize(options)
  @config = options[:config]
  @recipients = []

  self.load_driver
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



4
5
6
# File 'lib/jung/list.rb', line 4

def config
  @config
end

#recipientsObject

Returns the value of attribute recipients.



5
6
7
# File 'lib/jung/list.rb', line 5

def recipients
  @recipients
end

Instance Method Details

#create_recipient(attributes) ⇒ Object



18
19
20
# File 'lib/jung/list.rb', line 18

def create_recipient(attributes)
  self.recipients << Jung::Recipient.new(attributes)
end

#find_recipient_by_address(address) ⇒ Object



22
23
24
25
26
27
# File 'lib/jung/list.rb', line 22

def find_recipient_by_address(address)
  recipients.each do |recipient|
    return recipient if recipient.address == address
  end
  return nil
end

#load_driverObject



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

def load_driver
  self.extend config.driver_const
end