Class: MessagePack::IDL::AST::Type

Inherits:
Element
  • Object
show all
Defined in:
lib/msgpack/idl/ast.rb

Direct Known Subclasses

GenericType

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Element

#summary

Constructor Details

#initialize(name, nullable = false) ⇒ Type

Returns a new instance of Type.



264
265
266
267
# File 'lib/msgpack/idl/ast.rb', line 264

def initialize(name, nullable=false)
	@name = name
	@nullable = nullable
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



268
269
270
# File 'lib/msgpack/idl/ast.rb', line 268

def name
  @name
end

#nullableObject (readonly)

Returns the value of attribute nullable.



268
269
270
# File 'lib/msgpack/idl/ast.rb', line 268

def nullable
  @nullable
end

Instance Method Details

#nullable?Boolean

Returns:

  • (Boolean)


270
271
272
# File 'lib/msgpack/idl/ast.rb', line 270

def nullable?
	@nullable
end

#textObject



274
275
276
277
278
279
280
# File 'lib/msgpack/idl/ast.rb', line 274

def text
	if @nullable
		"#{@name}?"
	else
		"#{@name}"
	end
end