Class: Reflekt::ArrayMeta

Inherits:
Meta
  • Object
show all
Defined in:
lib/meta/array_meta.rb

Instance Method Summary collapse

Methods inherited from Meta

deserialize, numeric?

Constructor Details

#initializeArrayMeta

Returns a new instance of ArrayMeta.



6
7
8
9
10
11
# File 'lib/meta/array_meta.rb', line 6

def initialize()
  @type = :array
  @min = nil
  @max = nil
  @length = nil
end

Instance Method Details

#load(value) ⇒ Object

Parameters:

  • value (Array)


16
17
18
19
20
# File 'lib/meta/array_meta.rb', line 16

def load(value)
  @min = value.min()
  @max = value.max()
  @length = value.length()
end

#serializeObject



22
23
24
25
26
27
28
29
# File 'lib/meta/array_meta.rb', line 22

def serialize()
  {
    :type => @type,
    :max => @max,
    :min => @min,
    :length => @length
  }
end