Class: OmniHooks::Strategy::Namespace

Inherits:
Struct
  • Object
show all
Defined in:
lib/omnihooks/strategy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#delimiterObject

Returns the value of attribute delimiter

Returns:

  • (Object)

    the current value of delimiter



150
151
152
# File 'lib/omnihooks/strategy.rb', line 150

def delimiter
  @delimiter
end

#prefixObject

Returns the value of attribute prefix

Returns:

  • (Object)

    the current value of prefix



150
151
152
# File 'lib/omnihooks/strategy.rb', line 150

def prefix
  @prefix
end

Instance Method Details

#call(name = nil) ⇒ Object



151
152
153
# File 'lib/omnihooks/strategy.rb', line 151

def call(name = nil)
  "#{prefix}#{delimiter}#{name}"
end

#to_regexp(name = nil) ⇒ Object



155
156
157
# File 'lib/omnihooks/strategy.rb', line 155

def to_regexp(name = nil)
  %r{^#{Regexp.escape(call(name))}}
end