Class: CreateRectangleBoundsContext

Inherits:
Object
  • Object
show all
Defined in:
lib/motion_sprites/interactions/contexts/create_rectangle_bounds_context.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rect_coords) ⇒ CreateRectangleBoundsContext

Returns a new instance of CreateRectangleBoundsContext.



6
7
8
9
10
# File 'lib/motion_sprites/interactions/contexts/create_rectangle_bounds_context.rb', line 6

def initialize(rect_coords)
  @rect_coords = rect_coords
  @klass = Object.new
  @klass.extend RectangleRoles
end

Class Method Details

.call(rect_coords) ⇒ Object



2
3
4
# File 'lib/motion_sprites/interactions/contexts/create_rectangle_bounds_context.rb', line 2

def self.call(rect_coords)
  CreateRectangleBoundsContext.new(rect_coords).call
end

Instance Method Details

#callObject



12
13
14
# File 'lib/motion_sprites/interactions/contexts/create_rectangle_bounds_context.rb', line 12

def call
  @klass.make_rectangle @rect_coords
end