Class: MessagePack::IDL::AST::Message
- Defined in:
- lib/msgpack/idl/ast.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#super_class ⇒ Object
readonly
Returns the value of attribute super_class.
Instance Method Summary collapse
-
#initialize(name, super_class, fields) ⇒ Message
constructor
A new instance of Message.
- #text ⇒ Object
Methods inherited from Element
Constructor Details
#initialize(name, super_class, fields) ⇒ Message
Returns a new instance of Message.
73 74 75 76 77 |
# File 'lib/msgpack/idl/ast.rb', line 73 def initialize(name, super_class, fields) @name = name @super_class = super_class @fields = fields end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
78 79 80 |
# File 'lib/msgpack/idl/ast.rb', line 78 def fields @fields end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
78 79 80 |
# File 'lib/msgpack/idl/ast.rb', line 78 def name @name end |
#super_class ⇒ Object (readonly)
Returns the value of attribute super_class.
78 79 80 |
# File 'lib/msgpack/idl/ast.rb', line 78 def super_class @super_class end |
Instance Method Details
#text ⇒ Object
80 81 82 83 84 85 86 87 |
# File 'lib/msgpack/idl/ast.rb', line 80 def text t = "message #{@name}" t << " < #{@super_class.text}" if @super_class t << " {\n" t << @fields.map {|f| " #{f.text}\n" }.join t << "}" t end |