class PatternMatching::Configuration
Available configuration options are:
-
use_proc_helpers
: controls whether or not helpers for sending messages and calling a method in the local context are included with this module. -
use_binding_helper
: controls whether or not bindings are enabled (and thus) whether or not helpers are included. -
send_helper
: the method name used as the proc helper for “sending a message” to the object when matching. -
call_helper
: the method name used as the proc helper for “calling a method in the current context” with the object as an argument when matching. -
binding_helper
: the method name used as the binding set for each match.
Attributes
binding_helper[RW]
call_helper[RW]
send_helper[RW]
use_binding_helper[RW]
use_proc_helpers[RW]
Public Class Methods
default()
click to toggle source
# File lib/pattern_matching/configuration.rb, line 21 def self.default new(true, true, :S, :C, :B) end
new(use_proc_helpers, use_binding_helper, send_helper, call_helper, binding_helper)
click to toggle source
# File lib/pattern_matching/configuration.rb, line 31 def initialize(use_proc_helpers, use_binding_helper, send_helper, call_helper, binding_helper) @use_proc_helpers = use_proc_helpers @use_binding_helper = use_binding_helper @send_helper = send_helper @call_helper = call_helper @binding_helper = binding_helper end
Public Instance Methods
default_binding_helper?()
click to toggle source
# File lib/pattern_matching/configuration.rb, line 45 def default_binding_helper? :B == binding_helper end
default_proc_helpers?()
click to toggle source
# File lib/pattern_matching/configuration.rb, line 40 def default_proc_helpers? :S == send_helper && :C == call_helper end