Class: Lumos::Formatters::Base
- Inherits:
-
Object
- Object
- Lumos::Formatters::Base
- Includes:
- BaseChopper, BaseHorizontal
- Defined in:
- lib/lumos/formatters/base.rb
Instance Attribute Summary collapse
-
#delimiter ⇒ Object
readonly
Returns the value of attribute delimiter.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#padding ⇒ Object
readonly
Returns the value of attribute padding.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
- #message_length ⇒ Object
Methods included from BaseHorizontal
#horizontal_line, #horizontal_padding, #horizontal_pattern, #horizontal_result
Methods included from BaseChopper
#chopped_message, #chopped_message_length, #chopping_last_line?, #chopping_line, #chopping_padding, #iterate_chopped_lines
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
9 10 11 12 13 14 |
# File 'lib/lumos/formatters/base.rb', line 9 def initialize( = {}) @message = .fetch(:message) @delimiter = .fetch(:delimiter, "#").to_s @padding = .fetch(:padding, 1).to_i.abs @length = .fetch(:length, 70).to_i.abs end |
Instance Attribute Details
#delimiter ⇒ Object (readonly)
Returns the value of attribute delimiter.
7 8 9 |
# File 'lib/lumos/formatters/base.rb', line 7 def delimiter @delimiter end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
7 8 9 |
# File 'lib/lumos/formatters/base.rb', line 7 def length @length end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
7 8 9 |
# File 'lib/lumos/formatters/base.rb', line 7 def @message end |
#padding ⇒ Object (readonly)
Returns the value of attribute padding.
7 8 9 |
# File 'lib/lumos/formatters/base.rb', line 7 def padding @padding end |
Instance Method Details
#message_length ⇒ Object
16 17 18 |
# File 'lib/lumos/formatters/base.rb', line 16 def .to_s.size end |