Class: Wfstatus::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/wfstatus/builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, messages) ⇒ Builder

Returns a new instance of Builder.



5
6
7
8
# File 'lib/wfstatus/builder.rb', line 5

def initialize(config, messages)
  @config = config
  @messages = messages
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



4
5
6
# File 'lib/wfstatus/builder.rb', line 4

def config
  @config
end

#messagesObject (readonly)

Returns the value of attribute messages.



4
5
6
# File 'lib/wfstatus/builder.rb', line 4

def messages
  @messages
end

Instance Method Details

#contentObject



14
15
16
# File 'lib/wfstatus/builder.rb', line 14

def content
  relevant_messages.join("\n")
end

#relevant_messagesObject



10
11
12
# File 'lib/wfstatus/builder.rb', line 10

def relevant_messages
  @relevant_messages ||= @messages.select { |m| m.relevant? }
end