Class: MessagePack::IDL::AST::Service
- Defined in:
- lib/msgpack/idl/ast.rb
Instance Attribute Summary collapse
-
#functions ⇒ Object
readonly
Returns the value of attribute functions.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(name, version, functions) ⇒ Service
constructor
A new instance of Service.
- #text ⇒ Object
Methods inherited from Element
Constructor Details
#initialize(name, version, functions) ⇒ Service
Returns a new instance of Service.
155 156 157 158 159 |
# File 'lib/msgpack/idl/ast.rb', line 155 def initialize(name, version, functions) @name = name @version = version @functions = functions end |
Instance Attribute Details
#functions ⇒ Object (readonly)
Returns the value of attribute functions.
160 161 162 |
# File 'lib/msgpack/idl/ast.rb', line 160 def functions @functions end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
160 161 162 |
# File 'lib/msgpack/idl/ast.rb', line 160 def name @name end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
160 161 162 |
# File 'lib/msgpack/idl/ast.rb', line 160 def version @version end |
Instance Method Details
#text ⇒ Object
162 163 164 165 166 167 168 169 |
# File 'lib/msgpack/idl/ast.rb', line 162 def text t = "service #{@name}" t << ":#{@version}" if @version t << " {\n" t << @functions.map {|f| " #{f.text}\n" }.join t << "}" t end |