Class: CLUnit

Inherits:
CLValue show all
Defined in:
lib/types/cl_unit.rb

Instance Method Summary collapse

Methods inherited from CLValue

#to_hash

Constructor Details

#initialize(value = nil) ⇒ CLUnit

include CLValueBytesParsers::CLUnitBytesParser



10
11
12
13
14
15
# File 'lib/types/cl_unit.rb', line 10

def initialize(value = nil)
  raise "error"  unless value.nil?
  super
  @value =  nil
  @h = {}
end

Instance Method Details

#from_json(json) ⇒ Object



30
31
32
# File 'lib/types/cl_unit.rb', line 30

def from_json(json)
  JSON.parse(json)
end

#get_cl_typeObject



17
18
19
20
# File 'lib/types/cl_unit.rb', line 17

def get_cl_type
  @cl_type = CLUnitType.new
  @cl_type.to_string
end

#get_hashObject



34
35
36
# File 'lib/types/cl_unit.rb', line 34

def get_hash
  @h = {"bytes"=> "", "cl_type"=>get_cl_type}
end

#get_valueObject



22
23
24
# File 'lib/types/cl_unit.rb', line 22

def get_value
  @value
end

#to_jsonObject



26
27
28
# File 'lib/types/cl_unit.rb', line 26

def to_json
  {"bytes": "", "cl_type": get_cl_type}.to_json
end