Class: MessagePack::IDL::IR::Function

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

Direct Known Subclasses

InheritedFunction

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, return_type, args, exceptions) ⇒ Function

Returns a new instance of Function.



359
360
361
362
363
364
365
366
# File 'lib/msgpack/idl/ir.rb', line 359

def initialize(name, return_type, args, exceptions)
	@name = name
	@return_type = return_type
	@args = args
	@exceptions = exceptions
	@max_id = @args.map {|a| a.id }.max || 0
	@max_required_id = @args.select {|a| a.required? }.map {|a| a.id }.max || 0
end

Instance Attribute Details

#argsObject (readonly) Also known as: new_fields, all_fields

Returns the value of attribute args.



367
368
369
# File 'lib/msgpack/idl/ir.rb', line 367

def args
  @args
end

#exceptionsObject (readonly)

Returns the value of attribute exceptions.



367
368
369
# File 'lib/msgpack/idl/ir.rb', line 367

def exceptions
  @exceptions
end

#max_idObject (readonly)

Returns the value of attribute max_id.



368
369
370
# File 'lib/msgpack/idl/ir.rb', line 368

def max_id
  @max_id
end

#max_required_idObject (readonly)

Returns the value of attribute max_required_id.



368
369
370
# File 'lib/msgpack/idl/ir.rb', line 368

def max_required_id
  @max_required_id
end

#nameObject (readonly)

Returns the value of attribute name.



367
368
369
# File 'lib/msgpack/idl/ir.rb', line 367

def name
  @name
end

#return_typeObject (readonly)

Returns the value of attribute return_type.



367
368
369
# File 'lib/msgpack/idl/ir.rb', line 367

def return_type
  @return_type
end

Instance Method Details

#[](id) ⇒ Object



378
379
380
# File 'lib/msgpack/idl/ir.rb', line 378

def [](id)
	@args.find {|a| a.id == id }
end

#inherited?Boolean

Returns:

  • (Boolean)


374
375
376
# File 'lib/msgpack/idl/ir.rb', line 374

def inherited?
	false
end

#super_classObject



370
# File 'lib/msgpack/idl/ir.rb', line 370

def super_class; nil; end