Class: CLStringType

Inherits:
CLType show all
Defined in:
lib/types/cl_string_type.rb

Constant Summary

Constants inherited from CLType

CLType::TAGS

Instance Method Summary collapse

Methods inherited from CLType

#get_cl_type_tag, #get_link_to, #get_tag_key, #get_tag_value, #get_tags, #tag_value_isvalid

Constructor Details

#initialize(value = nil) ⇒ CLStringType

Returns a new instance of CLStringType.



7
8
9
10
# File 'lib/types/cl_string_type.rb', line 7

def initialize(value = nil)
  super(value)
  @value = value
end

Instance Method Details

#get_valueObject



16
17
18
# File 'lib/types/cl_string_type.rb', line 16

def get_value
  @value  
end

#to_bytesObject



24
25
26
# File 'lib/types/cl_string_type.rb', line 24

def to_bytes
  [10].pack("C*").unpack1("H*")
end

#to_jsonObject



20
21
22
# File 'lib/types/cl_string_type.rb', line 20

def to_json
  to_string
end

#to_stringObject



12
13
14
# File 'lib/types/cl_string_type.rb', line 12

def to_string
  TAGS.key(10).to_s
end