Class: Dumpdb::Settings::Base
- Inherits:
-
Object
- Object
- Dumpdb::Settings::Base
- Defined in:
- lib/dumpdb/settings.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#proc ⇒ Object
readonly
Returns the value of attribute proc.
Instance Method Summary collapse
-
#initialize(proc = nil) ⇒ Base
constructor
A new instance of Base.
- #value(script) ⇒ Object
Constructor Details
#initialize(proc = nil) ⇒ Base
Returns a new instance of Base.
9 10 11 |
# File 'lib/dumpdb/settings.rb', line 9 def initialize(proc = nil) @proc = proc.kind_of?(::Proc) ? proc : Proc.new { proc } end |
Instance Attribute Details
#proc ⇒ Object (readonly)
Returns the value of attribute proc.
7 8 9 |
# File 'lib/dumpdb/settings.rb', line 7 def proc @proc end |
Instance Method Details
#value(script) ⇒ Object
13 14 15 |
# File 'lib/dumpdb/settings.rb', line 13 def value(script) script.instance_eval &@proc end |