Class: Bmg::Relation::InMemory
- Inherits:
-
Object
- Object
- Bmg::Relation::InMemory
- Includes:
- Bmg::Relation
- Defined in:
- lib/bmg/relation/in_memory.rb,
lib/bmg/relation/in_memory/mutable.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Mutable
Instance Attribute Summary collapse
-
#operand ⇒ Object
readonly
Returns the value of attribute operand.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #_count ⇒ Object
- #each(&bl) ⇒ Object
-
#initialize(type, operand) ⇒ InMemory
constructor
A new instance of InMemory.
- #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, operand) ⇒ InMemory
Returns a new instance of InMemory.
6 7 8 9 |
# File 'lib/bmg/relation/in_memory.rb', line 6 def initialize(type, operand) @operand = operand @type = type end |
Instance Attribute Details
#operand ⇒ Object (readonly)
Returns the value of attribute operand.
11 12 13 |
# File 'lib/bmg/relation/in_memory.rb', line 11 def operand @operand end |
#type ⇒ Object
Returns the value of attribute type.
10 11 12 |
# File 'lib/bmg/relation/in_memory.rb', line 10 def type @type end |
Instance Method Details
#_count ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/bmg/relation/in_memory.rb', line 19 def _count if operand.respond_to?(:count) operand.count elsif operand.respond_to?(:size) operand.size else super end end |
#each(&bl) ⇒ Object
15 16 17 |
# File 'lib/bmg/relation/in_memory.rb', line 15 def each(&bl) @operand.each(&bl) end |
#inspect ⇒ Object
37 38 39 |
# File 'lib/bmg/relation/in_memory.rb', line 37 def inspect "(in_memory #{operand.inspect})" end |
#to_ast ⇒ Object
29 30 31 |
# File 'lib/bmg/relation/in_memory.rb', line 29 def to_ast [ :in_memory, operand ] end |
#to_s ⇒ Object
33 34 35 |
# File 'lib/bmg/relation/in_memory.rb', line 33 def to_s "(in_memory ...)" end |