Class: MessagePack::IDL::AST::Namespace

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Element

#summary

Constructor Details

#initialize(scopes, lang = nil) ⇒ Namespace

Returns a new instance of Namespace.



56
57
58
59
# File 'lib/msgpack/idl/ast.rb', line 56

def initialize(scopes, lang=nil)
	@scopes = scopes
	@lang = lang
end

Instance Attribute Details

#langObject (readonly)

Returns the value of attribute lang.



60
61
62
# File 'lib/msgpack/idl/ast.rb', line 60

def lang
  @lang
end

#scopesObject (readonly)

Returns the value of attribute scopes.



60
61
62
# File 'lib/msgpack/idl/ast.rb', line 60

def scopes
  @scopes
end

Instance Method Details

#textObject



62
63
64
65
66
67
68
# File 'lib/msgpack/idl/ast.rb', line 62

def text
	if @lang
		"namespace #{@lang} #{@scopes.join('.')}"
	else
		"namespace #{@scopes.join('.')}"
	end
end