Class: MemberDef

Inherits:
Def
  • Object
show all
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

Attributes inherited from Def

#ast

Instance Method Summary collapse

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

#docObject (readonly)

Returns the value of attribute doc.



101
102
103
# File 'lib/runtime.rb', line 101

def doc
  @doc
end

#nameObject (readonly)

Returns the value of attribute name.



101
102
103
# File 'lib/runtime.rb', line 101

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



101
102
103
# File 'lib/runtime.rb', line 101

def type
  @type
end

Instance Method Details

#elixir_nameObject



375
376
377
# File 'lib/generators/elixir_server_generator.rb', line 375

def elixir_name
    @name.underscore
end

#scala_readObject



93
94
95
# File 'lib/generators/scala_server_generator.rb', line 93

def scala_read
  @type.scala_read true
end

#scala_writeObject



97
98
99
# File 'lib/generators/scala_server_generator.rb', line 97

def scala_write
  @type.scala_write @name, true
end

#unity_defObject



128
129
130
# File 'lib/generators/unity_client_generator.rb', line 128

def unity_def
  "public #{unity_param};"
end

#unity_paramObject



132
133
134
# File 'lib/generators/unity_client_generator.rb', line 132

def unity_param
  "#{@type.unity} #{@name}"
end

#unity_readObject



136
137
138
# File 'lib/generators/unity_client_generator.rb', line 136

def unity_read
  "#{@name} = #{@type.unity_read true};"
end

#unity_writeObject



140
141
142
# File 'lib/generators/unity_client_generator.rb', line 140

def unity_write
  "#{@type.unity_write @name, true};"
end