Class: MemberDef
- Defined in:
- lib/runtime.rb,
lib/generators/scala_server_generator.rb,
lib/generators/unity_client_generator.rb,
lib/generators/elixir_server_generator.rb
Instance Attribute Summary collapse
-
#doc ⇒ Object
readonly
Returns the value of attribute doc.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from Def
Instance Method Summary collapse
- #elixir_name ⇒ Object
-
#initialize(ast, type) ⇒ MemberDef
constructor
A new instance of MemberDef.
- #scala_read ⇒ Object
- #scala_write ⇒ Object
- #unity_def ⇒ Object
- #unity_param ⇒ Object
- #unity_read ⇒ Object
- #unity_write ⇒ Object
Constructor Details
#initialize(ast, type) ⇒ MemberDef
Returns a new instance of MemberDef.
103 104 105 106 107 108 |
# File 'lib/runtime.rb', line 103 def initialize ast, type super ast @name = ast.name @type = type @doc = ast.doc end |
Instance Attribute Details
#doc ⇒ Object (readonly)
Returns the value of attribute doc.
101 102 103 |
# File 'lib/runtime.rb', line 101 def doc @doc end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
101 102 103 |
# File 'lib/runtime.rb', line 101 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
101 102 103 |
# File 'lib/runtime.rb', line 101 def type @type end |
Instance Method Details
#elixir_name ⇒ Object
375 376 377 |
# File 'lib/generators/elixir_server_generator.rb', line 375 def elixir_name @name.underscore end |
#scala_read ⇒ Object
93 94 95 |
# File 'lib/generators/scala_server_generator.rb', line 93 def scala_read @type.scala_read true end |
#scala_write ⇒ Object
97 98 99 |
# File 'lib/generators/scala_server_generator.rb', line 97 def scala_write @type.scala_write @name, true end |
#unity_def ⇒ Object
128 129 130 |
# File 'lib/generators/unity_client_generator.rb', line 128 def unity_def "public #{unity_param};" end |
#unity_param ⇒ Object
132 133 134 |
# File 'lib/generators/unity_client_generator.rb', line 132 def unity_param "#{@type.unity} #{@name}" end |
#unity_read ⇒ Object
136 137 138 |
# File 'lib/generators/unity_client_generator.rb', line 136 def unity_read "#{@name} = #{@type.unity_read true};" end |
#unity_write ⇒ Object
140 141 142 |
# File 'lib/generators/unity_client_generator.rb', line 140 def unity_write "#{@type.unity_write @name, true};" end |