Class: GoldenFleece::Format
- Inherits:
-
Object
- Object
- GoldenFleece::Format
- Defined in:
- lib/golden_fleece/format.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, fn) ⇒ Format
constructor
A new instance of Format.
- #validate(record, value) ⇒ Object
Constructor Details
#initialize(name, fn) ⇒ Format
Returns a new instance of Format.
5 6 7 8 |
# File 'lib/golden_fleece/format.rb', line 5 def initialize(name, fn) @name = name @fn = fn end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/golden_fleece/format.rb', line 3 def name @name end |
Instance Method Details
#validate(record, value) ⇒ Object
10 11 12 |
# File 'lib/golden_fleece/format.rb', line 10 def validate(record, value) fn.call record, value end |