Class: MessagePack::IDL::IR::Function
- Inherits:
-
Object
- Object
- MessagePack::IDL::IR::Function
- Defined in:
- lib/msgpack/idl/ir.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#args ⇒ Object
(also: #new_fields, #all_fields)
readonly
Returns the value of attribute args.
-
#exceptions ⇒ Object
readonly
Returns the value of attribute exceptions.
-
#max_id ⇒ Object
readonly
Returns the value of attribute max_id.
-
#max_required_id ⇒ Object
readonly
Returns the value of attribute max_required_id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#return_type ⇒ Object
readonly
Returns the value of attribute return_type.
Instance Method Summary collapse
- #[](id) ⇒ Object
- #inherited? ⇒ Boolean
-
#initialize(name, return_type, args, exceptions) ⇒ Function
constructor
A new instance of Function.
- #super_class ⇒ Object
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
#args ⇒ Object (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 |
#exceptions ⇒ Object (readonly)
Returns the value of attribute exceptions.
367 368 369 |
# File 'lib/msgpack/idl/ir.rb', line 367 def exceptions @exceptions end |
#max_id ⇒ Object (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_id ⇒ Object (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 |
#name ⇒ Object (readonly)
Returns the value of attribute name.
367 368 369 |
# File 'lib/msgpack/idl/ir.rb', line 367 def name @name end |
#return_type ⇒ Object (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
374 375 376 |
# File 'lib/msgpack/idl/ir.rb', line 374 def inherited? false end |
#super_class ⇒ Object
370 |
# File 'lib/msgpack/idl/ir.rb', line 370 def super_class; nil; end |