Class: Stamp::Emitters::Delegate
- Inherits:
-
Object
- Object
- Stamp::Emitters::Delegate
- Defined in:
- lib/stamp/emitters/delegate.rb
Constant Summary collapse
- ZONE =
new(:zone, "%Z")
- YEAR =
new(:year, "%Y")
- MONTH =
new(:month, "%-m")
- DAY =
new(:day, "%-d")
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#strftime_directive ⇒ Object
readonly
Returns the value of attribute strftime_directive.
Instance Method Summary collapse
- #format(target) ⇒ Object
-
#initialize(field, strftime_directive) ⇒ Delegate
constructor
A new instance of Delegate.
Constructor Details
#initialize(field, strftime_directive) ⇒ Delegate
Returns a new instance of Delegate.
7 8 9 10 |
# File 'lib/stamp/emitters/delegate.rb', line 7 def initialize(field, strftime_directive) @field = field @strftime_directive = strftime_directive end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
4 5 6 |
# File 'lib/stamp/emitters/delegate.rb', line 4 def field @field end |
#strftime_directive ⇒ Object (readonly)
Returns the value of attribute strftime_directive.
4 5 6 |
# File 'lib/stamp/emitters/delegate.rb', line 4 def strftime_directive @strftime_directive end |
Instance Method Details
#format(target) ⇒ Object
13 14 15 |
# File 'lib/stamp/emitters/delegate.rb', line 13 def format(target) target.send(field) end |