Class: Daru::Core::Query::BoolArray
Instance Attribute Summary collapse
-
#barry ⇒ Object
readonly
Returns the value of attribute barry.
Instance Method Summary collapse
- #! ⇒ Object
- #&(other) ⇒ Object (also: #and)
- #==(other) ⇒ Object
-
#initialize(barry) ⇒ BoolArray
constructor
A new instance of BoolArray.
- #inspect ⇒ Object
- #to_a ⇒ Object
- #|(other) ⇒ Object (also: #or)
Constructor Details
#initialize(barry) ⇒ BoolArray
Returns a new instance of BoolArray.
7 8 9 |
# File 'lib/daru/core/query.rb', line 7 def initialize @barry = end |
Instance Attribute Details
#barry ⇒ Object (readonly)
Returns the value of attribute barry.
5 6 7 |
# File 'lib/daru/core/query.rb', line 5 def @barry end |
Instance Method Details
#! ⇒ Object
23 24 25 |
# File 'lib/daru/core/query.rb', line 23 def ! BoolArray.new(@barry.map(&:!)) end |
#&(other) ⇒ Object Also known as: and
11 12 13 |
# File 'lib/daru/core/query.rb', line 11 def & other BoolArray.new @barry.zip(other.).map { |b, o| b && o } end |
#==(other) ⇒ Object
27 28 29 |
# File 'lib/daru/core/query.rb', line 27 def == other @barry == other. end |
#inspect ⇒ Object
35 36 37 |
# File 'lib/daru/core/query.rb', line 35 def inspect "#<#{self.class}:#{object_id} bool_arry=#{@barry}>" end |
#to_a ⇒ Object
31 32 33 |
# File 'lib/daru/core/query.rb', line 31 def to_a @barry end |