Class: MessagePack::IDL::AST::Application
- Defined in:
- lib/msgpack/idl/ast.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#scopes ⇒ Object
readonly
Returns the value of attribute scopes.
Instance Method Summary collapse
-
#initialize(name, scopes) ⇒ Application
constructor
A new instance of Application.
- #text ⇒ Object
Methods inherited from Element
Constructor Details
#initialize(name, scopes) ⇒ Application
Returns a new instance of Application.
226 227 228 229 |
# File 'lib/msgpack/idl/ast.rb', line 226 def initialize(name, scopes) @name = name @scopes = scopes end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
231 232 233 |
# File 'lib/msgpack/idl/ast.rb', line 231 def name @name end |
#scopes ⇒ Object (readonly)
Returns the value of attribute scopes.
232 233 234 |
# File 'lib/msgpack/idl/ast.rb', line 232 def scopes @scopes end |
Instance Method Details
#text ⇒ Object
234 235 236 237 238 239 |
# File 'lib/msgpack/idl/ast.rb', line 234 def text t = "application #{@name} {\n" t << @scopes.map {|sc| " #{sc.text}\n" }.join t << "}" t end |