Class: MessagePack::IDL::AST::InheritFunc

Inherits:
Inherit 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(name, return_type, args, exceptions) ⇒ InheritFunc

Returns a new instance of InheritFunc.



193
194
195
196
197
198
# File 'lib/msgpack/idl/ast.rb', line 193

def initialize(name, return_type, args, exceptions)
	@name = name
	@return_type = return_type
	@args = args
	@exceptions = exceptions
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



199
200
201
# File 'lib/msgpack/idl/ast.rb', line 199

def args
  @args
end

#exceptionsObject (readonly)

Returns the value of attribute exceptions.



199
200
201
# File 'lib/msgpack/idl/ast.rb', line 199

def exceptions
  @exceptions
end

#nameObject (readonly)

Returns the value of attribute name.



199
200
201
# File 'lib/msgpack/idl/ast.rb', line 199

def name
  @name
end

#return_typeObject (readonly)

Returns the value of attribute return_type.



199
200
201
# File 'lib/msgpack/idl/ast.rb', line 199

def return_type
  @return_type
end

Instance Method Details

#textObject



201
202
203
204
205
# File 'lib/msgpack/idl/ast.rb', line 201

def text
	t = "inherit #{@return_type.text} #{@name}(#{@args.map {|a| a.text }.join(', ') })"
	t << " throws #{@exceptions.map {|ex| ex.text }.join(', ')}" if @exceptions && !@exceptions.empty?
	t
end