Class: Hx::Path::Conjunction

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



112
113
114
115
116
117
118
119
120
121
# File 'lib/hx/path.rb', line 112

def self.build(*selectors)
  if selectors.any? { |s| All === s }
    selectors.reject! { |s| All === s }
    case selectors.size
    when 0; return ALL
    when 1; return selectors.first
    end
  end
  new(*selectors)
end

Instance Method Details

#accept_path?(path) ⇒ Boolean

Returns:

  • (Boolean)


123
124
125
# File 'lib/hx/path.rb', line 123

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