Module: Yargi

Defined in:
lib/yargi.rb,
lib/yargi/random.rb,
lib/yargi/digraph.rb,
lib/yargi/version.rb,
lib/yargi/decorate.rb,
lib/yargi/edge_set.rb,
lib/yargi/markable.rb,
lib/yargi/predicate.rb,
lib/yargi/vertex_set.rb,
lib/yargi/element_set.rb,
lib/yargi/digraph_edge.rb,
lib/yargi/digraph_vertex.rb

Defined Under Namespace

Modules: Markable, Version Classes: AndPredicate, Decorate, Digraph, EdgeSet, ElementSet, FalsePredicate, IndexPredicate, LambdaPredicate, NotPredicate, OrPredicate, Predicate, Random, TagPredicate, TruePredicate, VertexSet

Constant Summary collapse

ALL =

Predicates that always return true

Yargi::Predicate.to_predicate(true)
NONE =

Predicates that always return false

Yargi::Predicate.to_predicate(false)
VERSION =
Version.to_s

Class Method Summary collapse

Class Method Details

.predicate(what = nil, &block) ⇒ Object

When what is not nil, converts it to a predicate (typically a module). Otherwise, a block is expected, which is converted to a LambdaPredicate. Otherwise, return ALL.



9
10
11
# File 'lib/yargi.rb', line 9

def self.predicate(what=nil, &block)
  Predicate.to_predicate(what, &block)
end