Class: MessagePack::IDL::AST::Scope

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(service, version, name, default) ⇒ Scope

Returns a new instance of Scope.



243
244
245
246
247
248
# File 'lib/msgpack/idl/ast.rb', line 243

def initialize(service, version, name, default)
	@service = service
	@version = version
	@name = name
	@default = default
end

Instance Attribute Details

#defaultObject (readonly)

Returns the value of attribute default.



249
250
251
# File 'lib/msgpack/idl/ast.rb', line 249

def default
  @default
end

#nameObject (readonly)

Returns the value of attribute name.



249
250
251
# File 'lib/msgpack/idl/ast.rb', line 249

def name
  @name
end

#serviceObject (readonly)

Returns the value of attribute service.



249
250
251
# File 'lib/msgpack/idl/ast.rb', line 249

def service
  @service
end

#versionObject (readonly)

Returns the value of attribute version.



249
250
251
# File 'lib/msgpack/idl/ast.rb', line 249

def version
  @version
end

Instance Method Details

#default?Boolean

Returns:

  • (Boolean)


251
252
253
# File 'lib/msgpack/idl/ast.rb', line 251

def default?
	@default
end

#textObject



255
256
257
258
259
# File 'lib/msgpack/idl/ast.rb', line 255

def text
	t = "#{@service}:#{@version} #{@name}"
	t << " default" if @default
	t
end