Class: Protobuf::Message::ExtensionFields
- Inherits:
-
Hash
- Object
- Hash
- Protobuf::Message::ExtensionFields
- Defined in:
- lib/protobuf/message/message.rb
Instance Method Summary collapse
- #[]=(key, value) ⇒ Object
- #include_tag?(tag) ⇒ Boolean
-
#initialize(key_range = 0..-1)) ⇒ ExtensionFields
constructor
A new instance of ExtensionFields.
Constructor Details
#initialize(key_range = 0..-1)) ⇒ ExtensionFields
Returns a new instance of ExtensionFields.
14 15 16 |
# File 'lib/protobuf/message/message.rb', line 14 def initialize(key_range=0..-1) @key_range = key_range end |
Instance Method Details
#[]=(key, value) ⇒ Object
18 19 20 21 |
# File 'lib/protobuf/message/message.rb', line 18 def []=(key, value) raise RangeError, "#{key} is not in #{@key_range}" unless @key_range.include?(key) super end |
#include_tag?(tag) ⇒ Boolean
23 24 25 |
# File 'lib/protobuf/message/message.rb', line 23 def include_tag?(tag) @key_range.include?(tag) end |