Class: Protobuf::Node::ExtensionRangeNode

Inherits:
Base
  • Object
show all
Defined in:
lib/protobuf/compiler/nodes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#accept_descriptor_visitor, #accept_message_visitor, #accept_rpc_visitor, #define_in_the_file

Constructor Details

#initialize(low, high = nil) ⇒ ExtensionRangeNode

Returns a new instance of ExtensionRangeNode.



303
304
305
# File 'lib/protobuf/compiler/nodes.rb', line 303

def initialize(low, high=nil)
  @low, @high = low, high
end

Instance Attribute Details

#highObject (readonly)

Returns the value of attribute high.



301
302
303
# File 'lib/protobuf/compiler/nodes.rb', line 301

def high
  @high
end

#lowObject (readonly)

Returns the value of attribute low.



301
302
303
# File 'lib/protobuf/compiler/nodes.rb', line 301

def low
  @low
end

Instance Method Details

#to_sObject

def accept_message_visitor(visitor) end



310
311
312
313
314
315
316
317
318
# File 'lib/protobuf/compiler/nodes.rb', line 310

def to_s
  if @high.nil?
    @low.to_s
  elsif @high == :max
    "#{@low}..::Protobuf::Extend::MAX"
  else
    "#{@low}..#{@high}"
  end
end