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.



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

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.



38
39
40
# File 'lib/ehb_game_lib/math/rectable_object.rb', line 38

def anchor
  @anchor
end

Instance Method Details

#coordObject



46
47
48
# File 'lib/ehb_game_lib/math/rectable_object.rb', line 46

def coord
  @coord_get.call
end

#coord=(v) ⇒ Object



50
51
52
# File 'lib/ehb_game_lib/math/rectable_object.rb', line 50

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

#sizeObject



54
55
56
# File 'lib/ehb_game_lib/math/rectable_object.rb', line 54

def size
  @size_get.call
end