Class: Component
- Inherits:
-
Object
- Object
- Component
- Defined in:
- lib/panda_motd/component.rb
Direct Known Subclasses
ASCIITextArt, Fail2Ban, Filesystems, LastLogin, SSLCertificates, ServiceStatus, Uptime
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#results ⇒ Object
readonly
Returns the value of attribute results.
Instance Method Summary collapse
-
#initialize(motd, name) ⇒ Component
constructor
A new instance of Component.
- #lines_after ⇒ Object
- #lines_before ⇒ Object
- #process ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(motd, name) ⇒ Component
Returns a new instance of Component.
4 5 6 7 8 9 |
# File 'lib/panda_motd/component.rb', line 4 def initialize(motd, name) @name = name @motd = motd @config = motd.config.component_config(@name) @errors = [] end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
2 3 4 |
# File 'lib/panda_motd/component.rb', line 2 def config @config end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
2 3 4 |
# File 'lib/panda_motd/component.rb', line 2 def errors @errors end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/panda_motd/component.rb', line 2 def name @name end |
#results ⇒ Object (readonly)
Returns the value of attribute results.
2 3 4 |
# File 'lib/panda_motd/component.rb', line 2 def results @results end |
Instance Method Details
#lines_after ⇒ Object
23 24 25 |
# File 'lib/panda_motd/component.rb', line 23 def lines_after @motd.config.component_config(@name)['lines_after'] || 1 end |
#lines_before ⇒ Object
19 20 21 |
# File 'lib/panda_motd/component.rb', line 19 def lines_before @motd.config.component_config(@name)['lines_before'] || 1 end |
#process ⇒ Object
11 12 13 |
# File 'lib/panda_motd/component.rb', line 11 def process raise NotImplementedError end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/panda_motd/component.rb', line 15 def to_s raise NotImplementedError end |