Class: Charming::Projectile::Vector

Inherits:
Data
  • Object
show all
Defined in:
lib/charming/projectile.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x:, y:, z: 0.0) ⇒ Vector

Returns a new instance of Vector.



24
25
26
# File 'lib/charming/projectile.rb', line 24

def initialize(x:, y:, z: 0.0)
  super
end

Instance Attribute Details

#xObject (readonly)

Returns the value of attribute x

Returns:

  • (Object)

    the current value of x



23
24
25
# File 'lib/charming/projectile.rb', line 23

def x
  @x
end

#yObject (readonly)

Returns the value of attribute y

Returns:

  • (Object)

    the current value of y



23
24
25
# File 'lib/charming/projectile.rb', line 23

def y
  @y
end

#zObject (readonly)

Returns the value of attribute z

Returns:

  • (Object)

    the current value of z



23
24
25
# File 'lib/charming/projectile.rb', line 23

def z
  @z
end