class Component

Attributes

config[R]
errors[R]
name[R]
results[R]

Public Class Methods

new(motd, name) click to toggle source
# File lib/panda_motd/component.rb, line 6
def initialize(motd, name)
  @name = name
  @motd = motd
  @config = motd.config.component_config(@name)
  @errors = []
end

Public Instance Methods

lines_after() click to toggle source

The number of lines to print after the component in the context of the entire MOTD. 1 by default, if not configured.

# File lib/panda_motd/component.rb, line 32
def lines_after
  @motd.config.component_config(@name)["lines_after"] || 1
end
lines_before() click to toggle source

The number of lines to print before the component in the context of the entire MOTD. 1 by default, if not configured.

# File lib/panda_motd/component.rb, line 26
def lines_before
  @motd.config.component_config(@name)["lines_before"] || 1
end
process() click to toggle source

Evaluates the component so that it has some meaningful output when it comes time to print the MOTD.

# File lib/panda_motd/component.rb, line 15
def process
  raise NotImplementedError
end
to_s() click to toggle source

Gives the output of a component as a string.

# File lib/panda_motd/component.rb, line 20
def to_s
  raise NotImplementedError
end