Class: CLUnit
Instance Method Summary collapse
- #from_json(json) ⇒ Object
- #get_cl_type ⇒ Object
- #get_hash ⇒ Object
- #get_value ⇒ Object
-
#initialize(value = nil) ⇒ CLUnit
constructor
include CLValueBytesParsers::CLUnitBytesParser.
- #to_json ⇒ Object
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_type ⇒ Object
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_hash ⇒ Object
34 35 36 |
# File 'lib/types/cl_unit.rb', line 34 def get_hash @h = {"bytes"=> "", "cl_type"=>get_cl_type} end |
#get_value ⇒ Object
22 23 24 |
# File 'lib/types/cl_unit.rb', line 22 def get_value @value end |
#to_json ⇒ Object
26 27 28 |
# File 'lib/types/cl_unit.rb', line 26 def to_json {"bytes": "", "cl_type": get_cl_type}.to_json end |