Class: Ruml::List

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ List

Returns a new instance of List.



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

def initialize(path)
  @config = Config.new(path)
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



3
4
5
# File 'lib/ruml/list.rb', line 3

def config
  @config
end

Instance Method Details

#bounce_toObject



29
30
31
# File 'lib/ruml/list.rb', line 29

def bounce_to
  @bounce_to ||= lines("bounce_to").first || to
end

#idObject



13
14
15
# File 'lib/ruml/list.rb', line 13

def id
  @id ||= to.gsub('@', '.')
end

#membersObject



21
22
23
# File 'lib/ruml/list.rb', line 21

def members
  @members ||= lines("members").map(&:downcase).uniq.reject { |member| member =~ /^#|^$/ }
end

#nameObject



17
18
19
# File 'lib/ruml/list.rb', line 17

def name
  @name ||= lines("name").first
end

#pathObject



9
10
11
# File 'lib/ruml/list.rb', line 9

def path
  config.path
end

#toObject



25
26
27
# File 'lib/ruml/list.rb', line 25

def to
  @to ||= lines("to").first
end