Class: Bmg::Relation::Empty
- Inherits:
-
Object
- Object
- Bmg::Relation::Empty
- Includes:
- Bmg::Relation
- Defined in:
- lib/bmg/relation/empty.rb
Overview
The empty relation, of a given type.
This relation implementation exists mostly for optimization purposes, since knowing that a relation is empty allows simplifying many expressions.
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #_count ⇒ Object
- #each(&bl) ⇒ Object
-
#initialize(type) ⇒ Empty
constructor
A new instance of Empty.
- #inspect ⇒ Object
- #to_ast ⇒ Object
- #to_s ⇒ Object
Methods included from Bmg::Relation
#bind, #count, #debug, #delete, empty, #empty?, #insert, new, #one, #one_or_nil, #to_csv, #to_json, #to_xlsx, #update, #visit, #with_type, #with_type_attrlist, #with_typecheck, #without_typecheck, #y_by_x, #ys_by_x
Methods included from Algebra
#allbut, #autosummarize, #autowrap, #constants, #extend, #group, #image, #join, #left_join, #matching, #materialize, #minus, #not_matching, #page, #project, #rename, #restrict, #spied, #summarize, #transform, #ungroup, #union, #unspied, #unwrap
Methods included from Algebra::Shortcuts
#cross_product, #exclude, #image, #images, #join, #left_join, #matching, #not_matching, #prefix, #rxmatch, #suffix, #ungroup, #unwrap, #where
Constructor Details
#initialize(type) ⇒ Empty
Returns a new instance of Empty.
13 14 15 |
# File 'lib/bmg/relation/empty.rb', line 13 def initialize(type) @type = type end |
Instance Attribute Details
#type ⇒ Object
Returns the value of attribute type.
16 17 18 |
# File 'lib/bmg/relation/empty.rb', line 16 def type @type end |
Instance Method Details
#_count ⇒ Object
22 23 24 |
# File 'lib/bmg/relation/empty.rb', line 22 def _count 0 end |
#each(&bl) ⇒ Object
19 20 |
# File 'lib/bmg/relation/empty.rb', line 19 def each(&bl) end |
#inspect ⇒ Object
34 35 36 |
# File 'lib/bmg/relation/empty.rb', line 34 def inspect "(empty)" end |
#to_ast ⇒ Object
26 27 28 |
# File 'lib/bmg/relation/empty.rb', line 26 def to_ast [ :empty ] end |
#to_s ⇒ Object
30 31 32 |
# File 'lib/bmg/relation/empty.rb', line 30 def to_s "(empty)" end |