Class: Jung::List
- Inherits:
-
Object
- Object
- Jung::List
- Defined in:
- lib/jung/list.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#recipients ⇒ Object
Returns the value of attribute recipients.
Instance Method Summary collapse
- #create_recipient(attributes) ⇒ Object
- #find_recipient_by_address(address) ⇒ Object
-
#initialize(options) ⇒ List
constructor
A new instance of List.
- #load_driver ⇒ Object
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() @config = [:config] @recipients = [] self.load_driver end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
4 5 6 |
# File 'lib/jung/list.rb', line 4 def config @config end |
#recipients ⇒ Object
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_driver ⇒ Object
14 15 16 |
# File 'lib/jung/list.rb', line 14 def load_driver self.extend config.driver_const end |