Class: Yell::Formatter::Builder
- Inherits:
-
Object
- Object
- Yell::Formatter::Builder
- Defined in:
- lib/yell/formatter.rb
Overview
Builder class to allow setters that won’t be accessible once transferred to the Formatter
Instance Attribute Summary collapse
-
#date_pattern ⇒ Object
Returns the value of attribute date_pattern.
-
#modifier ⇒ Object
readonly
Returns the value of attribute modifier.
-
#pattern ⇒ Object
Returns the value of attribute pattern.
Instance Method Summary collapse
-
#initialize(pattern = nil, date_pattern = nil, &block) ⇒ Builder
constructor
A new instance of Builder.
- #modify(key, &block) ⇒ Object
Constructor Details
#initialize(pattern = nil, date_pattern = nil, &block) ⇒ Builder
Returns a new instance of Builder.
137 138 139 140 141 142 143 144 |
# File 'lib/yell/formatter.rb', line 137 def initialize( pattern = nil, date_pattern = nil, &block ) @modifier = Modifier.new @pattern = pattern || Yell::DefaultFormat @date_pattern = date_pattern || :iso8601 block.call(self) if block end |
Instance Attribute Details
#date_pattern ⇒ Object
Returns the value of attribute date_pattern.
134 135 136 |
# File 'lib/yell/formatter.rb', line 134 def date_pattern @date_pattern end |
#modifier ⇒ Object (readonly)
Returns the value of attribute modifier.
135 136 137 |
# File 'lib/yell/formatter.rb', line 135 def modifier @modifier end |
#pattern ⇒ Object
Returns the value of attribute pattern.
134 135 136 |
# File 'lib/yell/formatter.rb', line 134 def pattern @pattern end |
Instance Method Details
#modify(key, &block) ⇒ Object
146 147 148 |
# File 'lib/yell/formatter.rb', line 146 def modify( key, &block ) modifier.set(key, &block) end |