Class: Protobuf::Field::BaseFieldObjectDefinitions::StringSetField
- Inherits:
-
Object
- Object
- Protobuf::Field::BaseFieldObjectDefinitions::StringSetField
- Defined in:
- lib/protobuf/field/base_field_object_definitions.rb
Instance Method Summary collapse
- #call(values, value, _ignore_nil_for_repeated, _message_instance) ⇒ Object
-
#initialize(selph) ⇒ StringSetField
constructor
A new instance of StringSetField.
Constructor Details
#initialize(selph) ⇒ StringSetField
Returns a new instance of StringSetField.
311 312 313 314 315 |
# File 'lib/protobuf/field/base_field_object_definitions.rb', line 311 def initialize(selph) @selph = selph @tag = selph.tag @fully_qualified_name = selph.fully_qualified_name end |
Instance Method Details
#call(values, value, _ignore_nil_for_repeated, _message_instance) ⇒ Object
317 318 319 320 321 322 323 324 325 326 327 |
# File 'lib/protobuf/field/base_field_object_definitions.rb', line 317 def call(values, value, _ignore_nil_for_repeated, ) if value values[@fully_qualified_name] = if value.is_a?(String) value else @selph.coerce!(value) end else values.delete(@fully_qualified_name) end end |