Exception: SplitIoClient::Partition

Inherits:
NoMethodError
  • Object
show all
Defined in:
lib/engine/parser/partition.rb

Overview

acts as dto for a partition structure

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(partition) ⇒ Partition

Returns a new instance of Partition.



13
14
15
# File 'lib/engine/parser/partition.rb', line 13

def initialize(partition)
  @data = partition
end

Instance Attribute Details

#data ⇒ Object

definition of the condition



11
12
13
# File 'lib/engine/parser/partition.rb', line 11

def data
  @data
end

Instance Method Details

#is_empty? ⇒ boolean

Returns true if the partition is empty false otherwise.

Returns:

  • (boolean) —

    true if the partition is empty false otherwise



31
32
33
# File 'lib/engine/parser/partition.rb', line 31

def is_empty?
  @data.empty?
end

#size ⇒ object

Returns the size value for this partition.

Returns:

  • (object) —

    the size value for this partition



25
26
27
# File 'lib/engine/parser/partition.rb', line 25

def size
  @data[:size]
end

#treatment ⇒ object

Returns the treatment value for this partition.

Returns:

  • (object) —

    the treatment value for this partition



19
20
21
# File 'lib/engine/parser/partition.rb', line 19

def treatment
  @data[:treatment]
end