Class: Proc
- Includes:
- Rubylog::CompoundTerm, Rubylog::Goal
- Defined in:
- lib/rubylog/mixins/proc.rb
Instance Attribute Summary
Attributes included from Rubylog::CompoundTerm
Instance Method Summary collapse
-
#call_with_rubylog_variables(vars = nil) ⇒ Object
Calls the proc with the given rubylog variables or with the currently available variables.
- #prove ⇒ Object
- #rubylog_clone {|dup| ... } ⇒ Object
-
#rubylog_resolve_function ⇒ Object
Term methods.
Methods included from Rubylog::CompoundTerm
Methods included from Rubylog::Goal
Instance Method Details
#call_with_rubylog_variables(vars = nil) ⇒ Object
Calls the proc with the given rubylog variables or with the currently available variables.
25 26 27 28 29 30 31 32 33 |
# File 'lib/rubylog/mixins/proc.rb', line 25 def call_with_rubylog_variables vars = nil vars ||= @rubylog_variables raise Rubylog::InvalidStateError, "Variables not matched" if not vars # Call the block with the variables substituted Rubylog::DSL::Variables.with_vars vars do return call end end |
#prove ⇒ Object
6 7 8 |
# File 'lib/rubylog/mixins/proc.rb', line 6 def prove yield if call_with_rubylog_variables end |
#rubylog_clone {|dup| ... } ⇒ Object
12 13 14 |
# File 'lib/rubylog/mixins/proc.rb', line 12 def rubylog_clone yield dup end |
#rubylog_resolve_function ⇒ Object
Term methods
19 20 21 |
# File 'lib/rubylog/mixins/proc.rb', line 19 def rubylog_resolve_function call_with_rubylog_variables end |