Class: Hx::Path::AssumeCircumfix

Inherits:
Object
  • Object
show all
Includes:
Selector
Defined in:
lib/hx/path.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Selector

#&, #assume_circumfix, #elide_circumfix, #literal?, #|, #~

Constructor Details

#initialize(selector, prefix, suffix) ⇒ AssumeCircumfix

Returns a new instance of AssumeCircumfix.



167
168
169
170
171
# File 'lib/hx/path.rb', line 167

def initialize(selector, prefix, suffix)
  @selector = selector
  @prefix = prefix
  @suffix = suffix
end

Class Method Details

.build(selector, prefix, suffix) ⇒ Object



160
161
162
163
164
165
# File 'lib/hx/path.rb', line 160

def self.build(selector, prefix, suffix)
  case selector
  when All; ALL
  else; new(selector, prefix, suffix)
  end
end

Instance Method Details

#accept_path?(path) ⇒ Boolean

Returns:

  • (Boolean)


173
174
175
# File 'lib/hx/path.rb', line 173

def accept_path?(path)
  @selector.accept_path?("#{@prefix}#{path}#{@suffix}")
end