Class: Reflekt::StringMeta

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

Instance Method Summary collapse

Methods inherited from Meta

deserialize, numeric?

Constructor Details

#initializeStringMeta

Returns a new instance of StringMeta.



6
7
8
9
# File 'lib/meta/string_meta.rb', line 6

def initialize()
  @type = :string
  @length = nil
end

Instance Method Details

#load(value) ⇒ Object

Parameters:

  • value (String)


14
15
16
# File 'lib/meta/string_meta.rb', line 14

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

#serializeObject



18
19
20
21
22
23
# File 'lib/meta/string_meta.rb', line 18

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