Class: Hx::Path::Disjunction

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

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Connective

#initialize

Methods included from Selector

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

Class Method Details

.build(*selectors) ⇒ Object



131
132
133
134
# File 'lib/hx/path.rb', line 131

def self.build(*selectors)
  return ALL if selectors.any? { |s| All === s }
  new(*selectors)
end

Instance Method Details

#accept_path?(path) ⇒ Boolean

Returns:

  • (Boolean)


136
137
138
# File 'lib/hx/path.rb', line 136

def accept_path?(path)
  @selectors.any? { |s| s.accept_path? path }
end