Class: DirectionDef
- Defined in:
- lib/runtime.rb,
lib/generators/unity_client_generator.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
-
#doc ⇒ Object
readonly
Returns the value of attribute doc.
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
Attributes inherited from Def
Instance Method Summary collapse
- #add_message(message_def) ⇒ Object
-
#initialize(ast, client, server) ⇒ DirectionDef
constructor
A new instance of DirectionDef.
- #name ⇒ Object
- #unity_name ⇒ Object
Constructor Details
#initialize(ast, client, server) ⇒ DirectionDef
Returns a new instance of DirectionDef.
115 116 117 118 119 120 121 122 |
# File 'lib/runtime.rb', line 115 def initialize ast, client, server super ast @client = client @direction = ast.direction @server = server = {} @doc = ast.doc end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
113 114 115 |
# File 'lib/runtime.rb', line 113 def client @client end |
#direction ⇒ Object (readonly)
Returns the value of attribute direction.
113 114 115 |
# File 'lib/runtime.rb', line 113 def direction @direction end |
#doc ⇒ Object (readonly)
Returns the value of attribute doc.
113 114 115 |
# File 'lib/runtime.rb', line 113 def doc @doc end |
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
113 114 115 |
# File 'lib/runtime.rb', line 113 def end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
113 114 115 |
# File 'lib/runtime.rb', line 113 def server @server end |
Instance Method Details
#add_message(message_def) ⇒ Object
133 134 135 |
# File 'lib/runtime.rb', line 133 def [.name] = end |
#name ⇒ Object
124 125 126 127 128 129 130 131 |
# File 'lib/runtime.rb', line 124 def name case @direction when :left return "#{@client.name} <- #{@server.name}" when :right return "#{@client.name} -> #{@server.name}" end end |
#unity_name ⇒ Object
147 148 149 |
# File 'lib/generators/unity_client_generator.rb', line 147 def unity_name "#{@client}#{@server}Connector" end |