Class: MessagePack::IDL::AST::Func
- Defined in:
- lib/msgpack/idl/ast.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#exceptions ⇒ Object
readonly
Returns the value of attribute exceptions.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#return_type ⇒ Object
readonly
Returns the value of attribute return_type.
Instance Method Summary collapse
-
#initialize(name, return_type, args, exceptions) ⇒ Func
constructor
A new instance of Func.
- #text ⇒ Object
Methods inherited from Element
Constructor Details
#initialize(name, return_type, args, exceptions) ⇒ Func
Returns a new instance of Func.
209 210 211 212 213 214 |
# File 'lib/msgpack/idl/ast.rb', line 209 def initialize(name, return_type, args, exceptions) @name = name @return_type = return_type @args = args @exceptions = exceptions end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
215 216 217 |
# File 'lib/msgpack/idl/ast.rb', line 215 def args @args end |
#exceptions ⇒ Object (readonly)
Returns the value of attribute exceptions.
215 216 217 |
# File 'lib/msgpack/idl/ast.rb', line 215 def exceptions @exceptions end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
215 216 217 |
# File 'lib/msgpack/idl/ast.rb', line 215 def name @name end |
#return_type ⇒ Object (readonly)
Returns the value of attribute return_type.
215 216 217 |
# File 'lib/msgpack/idl/ast.rb', line 215 def return_type @return_type end |
Instance Method Details
#text ⇒ Object
217 218 219 220 221 |
# File 'lib/msgpack/idl/ast.rb', line 217 def text t = "#{@return_type.text} #{@name}(#{@args.map {|a| a.text }.join(', ')})" t << " throws #{@exceptions.map {|ex| ex.text }.join(', ')}" if @exceptions && !@exceptions.empty? t end |