Class: CLOption

Inherits:
CLValue show all
Includes:
CLValueBytesParsers::CLOptionBytesParser
Defined in:
lib/types/cl_option.rb

Overview

Instance Method Summary collapse

Methods included from CLValueBytesParsers::CLOptionBytesParser

#to_bytes

Methods inherited from CLValue

#to_hash

Constructor Details

#initialize(data = nil, inner_type = nil) ⇒ CLOption

Returns a new instance of CLOption.



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/types/cl_option.rb', line 12

def initialize(data = nil, inner_type = nil)
  super
  @data =  data
  @inner_type = inner_type
  if data == nil && inner_type == nil
    raise ArgumentError.new("You had to assign innerType for None")
  elsif data == nil && inner_type != nil
    @inner_type = inner_type
  else
    # @inner_type = data[:cl_type]
    @inner_type = data.get_cl_type
  end
end

Instance Method Details

#get_cl_typeObject



30
31
32
33
34
35
36
# File 'lib/types/cl_option.rb', line 30

def get_cl_type
 CLOptionType.new(@inner_type).get_type
=begin
 @inner_type
 get_type
=end
end

#get_inner_typeObject



38
39
40
# File 'lib/types/cl_option.rb', line 38

def get_inner_type
 @inner_type 
end

#get_valueObject



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

def get_value
  @data
end