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.
16 17 18 |
# File 'lib/protobuf/message/message.rb', line 16 def initialize(key_range=0..-1) @key_range = key_range end |
Instance Method Details
#[]=(key, value) ⇒ Object
20 21 22 23 |
# File 'lib/protobuf/message/message.rb', line 20 def []=(key, value) raise RangeError.new("#{key} is not in #{@key_range}") unless @key_range.include? key super end |
#include_tag?(tag) ⇒ Boolean
25 26 27 |
# File 'lib/protobuf/message/message.rb', line 25 def include_tag?(tag) @key_range.include? tag end |