Class: EhbGameLib::Math::RectableObject::Axis

Inherits:
Object
  • Object
show all
Defined in:
lib/ehb_game_lib/math/rectable_object.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(coord_get, coord_set, size_get) ⇒ Axis

Returns a new instance of Axis.



42
43
44
45
46
# File 'lib/ehb_game_lib/math/rectable_object.rb', line 42

def initialize(coord_get, coord_set, size_get)
  @coord_get = coord_get
  @coord_set = coord_set
  @size_get = size_get
end

Instance Attribute Details

#anchorObject

Returns the value of attribute anchor.



40
41
42
# File 'lib/ehb_game_lib/math/rectable_object.rb', line 40

def anchor
  @anchor
end

Instance Method Details

#coordObject



48
49
50
# File 'lib/ehb_game_lib/math/rectable_object.rb', line 48

def coord
  @coord_get.call
end

#coord=(v) ⇒ Object



52
53
54
# File 'lib/ehb_game_lib/math/rectable_object.rb', line 52

def coord=(v)
  @coord_set.call(v)
end

#sizeObject



56
57
58
# File 'lib/ehb_game_lib/math/rectable_object.rb', line 56

def size
  @size_get.call
end