Class: ProtocolBuffers::Field::BoolField
Instance Attribute Summary
#name, #otype, #tag
Instance Method Summary
collapse
#wire_type
#max, #min
#add_methods_to, #check_valid, create, #initialize, #inspect_value, #repeated?
Instance Method Details
#check_value(value) ⇒ Object
485
|
# File 'lib/protocol_buffers/runtime/field.rb', line 485
def check_value(value); end
|
#default_value ⇒ Object
491
492
493
|
# File 'lib/protocol_buffers/runtime/field.rb', line 491
def default_value
@opts[:default] || false
end
|
#deserialize(value) ⇒ Object
487
488
489
|
# File 'lib/protocol_buffers/runtime/field.rb', line 487
def deserialize(value)
value != 0
end
|
#serialize(value) ⇒ Object
477
478
479
|
# File 'lib/protocol_buffers/runtime/field.rb', line 477
def serialize(value)
value ? 1 : 0
end
|
#valid_type?(value) ⇒ Boolean
481
482
483
|
# File 'lib/protocol_buffers/runtime/field.rb', line 481
def valid_type?(value)
value == true || value == false
end
|