Class: CLOptionType
Constant Summary
Constants inherited
from CLType
CLType::TAGS
Class Method Summary
collapse
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(inner = nil) ⇒ CLOptionType
Returns a new instance of CLOptionType.
13
14
15
16
17
18
19
|
# File 'lib/types/cl_option_type.rb', line 13
def initialize(inner = nil)
@tag = TAGS[:Option]
@inner = inner
end
|
Class Method Details
.to_string ⇒ Object
45
46
47
|
# File 'lib/types/cl_option_type.rb', line 45
def self.to_string
TAGS.key(13).to_s
end
|
Instance Method Details
#get_inner_type ⇒ Object
36
37
38
|
# File 'lib/types/cl_option_type.rb', line 36
def get_inner_type
@inner
end
|
#get_type ⇒ Object
32
33
34
|
# File 'lib/types/cl_option_type.rb', line 32
def get_type
TAGS.key(13).to_s
end
|
#to_bytes ⇒ Object
40
41
42
43
|
# File 'lib/types/cl_option_type.rb', line 40
def to_bytes
arr = []
arr << @tag << @inner.get_tag
end
|
#to_json ⇒ Object
26
27
28
29
30
|
# File 'lib/types/cl_option_type.rb', line 26
def to_json
jsoned = { "#{TAGS.key(13)}": @inner.to_string }.to_json
end
|
#to_string ⇒ String
22
23
24
|
# File 'lib/types/cl_option_type.rb', line 22
def to_string
@inner == nil ? TAGS.key(13).to_s + " (None)" : TAGS.key(13).to_s + " (#{@inner.to_string})"
end
|