Class: Json::Streamer::Conditions

Inherits:
Object
  • Object
show all
Defined in:
lib/json/streamer/conditions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(yield_level: -1,, yield_key: nil) ⇒ Conditions

Returns a new instance of Conditions.



6
7
8
9
10
11
12
13
# File 'lib/json/streamer/conditions.rb', line 6

def initialize(yield_level: -1, yield_key: nil)
  @yield_level = yield_level
  @yield_key = yield_key

  @yield_value = ->(aggregator:, value:nil) { yield?(aggregator) }
  @yield_object = ->(aggregator:, object:nil) { yield?(aggregator) }
  @yield_array = ->(aggregator:, array:nil) { yield?(aggregator) }
end

Instance Attribute Details

#yield_arrayObject

Returns the value of attribute yield_array.



4
5
6
# File 'lib/json/streamer/conditions.rb', line 4

def yield_array
  @yield_array
end

#yield_objectObject

Returns the value of attribute yield_object.



4
5
6
# File 'lib/json/streamer/conditions.rb', line 4

def yield_object
  @yield_object
end

#yield_valueObject

Returns the value of attribute yield_value.



4
5
6
# File 'lib/json/streamer/conditions.rb', line 4

def yield_value
  @yield_value
end