Class: TJSON::DataType::Value
Overview
Constant Summary
TAGS
Instance Method Summary
collapse
Methods inherited from Scalar
#inspect, #scalar?
[], generate, identify_type, parse
Instance Method Details
#convert(value) ⇒ Object
11
12
13
14
15
|
# File 'lib/tjson/datatype/value.rb', line 11
def convert(value)
raise TJSON::TypeError, "'null' is expressly disallowed in TJSON" if value.nil?
raise TJSON::TypeError, "not a boolean value: #{value.inspect}" unless [true, false].include?(value)
value
end
|
#generate(value) ⇒ Object
17
18
19
|
# File 'lib/tjson/datatype/value.rb', line 17
def generate(value)
value
end
|
7
8
9
|
# File 'lib/tjson/datatype/value.rb', line 7
def tag
"v"
end
|