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.



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

def initialize(partition)
  @data = partition
end

Instance Attribute Details

#data ⇒ Object

definition of the condition



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

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



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

def is_empty?
  @data.empty? ? true : false
end

#size ⇒ object

Returns the size value for this partition.

Returns:

  • (object) —

    the size value for this partition



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

def size
  @data[:size]
end

#treatment ⇒ object

Returns the treatment value for this partition.

Returns:

  • (object) —

    the treatment value for this partition



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

def treatment
  @data[:treatment]
end