Class: Datacaster::Runner
Instance Method Summary collapse
- #cast(object, runtime:) ⇒ Object
-
#initialize(&block) ⇒ Runner
constructor
A new instance of Runner.
- #inspect ⇒ Object
Methods included from Mixin
#&, #*, #call, #call_with_runtime, #cast_errors, #i18n_key, #i18n_map_keys, #i18n_scope, #i18n_vars, #then, #with_context, #with_object_context, #with_runtime, #|
Constructor Details
#initialize(&block) ⇒ Runner
Returns a new instance of Runner.
3 4 5 6 7 |
# File 'lib/datacaster/runner.rb', line 3 def initialize(&block) raise "Expected block" unless block_given? @run = block end |
Instance Method Details
#cast(object, runtime:) ⇒ Object
9 10 11 12 |
# File 'lib/datacaster/runner.rb', line 9 def cast(object, runtime:) Runtimes::Base.(runtime, @run, object) Datacaster.ValidResult(object) end |
#inspect ⇒ Object
14 15 16 |
# File 'lib/datacaster/runner.rb', line 14 def inspect "#<Datacaster::Runner>" end |