Class: MessagePack::IDL::AST::InheritFunc
- 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) ⇒ InheritFunc
constructor
A new instance of InheritFunc.
- #text ⇒ Object
Methods inherited from Element
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
#args ⇒ Object (readonly)
Returns the value of attribute args.
199 200 201 |
# File 'lib/msgpack/idl/ast.rb', line 199 def args @args end |
#exceptions ⇒ Object (readonly)
Returns the value of attribute exceptions.
199 200 201 |
# File 'lib/msgpack/idl/ast.rb', line 199 def exceptions @exceptions end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
199 200 201 |
# File 'lib/msgpack/idl/ast.rb', line 199 def name @name end |
#return_type ⇒ Object (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
#text ⇒ Object
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 |