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.



305
306
307
# File 'lib/protobuf/compiler/nodes.rb', line 305

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

Instance Attribute Details

#highObject (readonly)

Returns the value of attribute high.



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

def high
  @high
end

#lowObject (readonly)

Returns the value of attribute low.



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

def low
  @low
end

Instance Method Details

#to_sObject

def accept_message_visitor(visitor) end



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

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