Class: CreateWithImageInRectangleBoundsContext

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sprite, rectangle) ⇒ CreateWithImageInRectangleBoundsContext

Returns a new instance of CreateWithImageInRectangleBoundsContext.



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

def initialize(sprite, rectangle)
  @sprite = sprite
  @rectangle = rectangle
  @klass = Object.new
  @klass.extend ImageRoles
end

Class Method Details

.call(sprite, rectangle) ⇒ Object



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

def self.call(sprite, rectangle)
  CreateWithImageInRectangleBoundsContext.new(sprite, rectangle).call
end

Instance Method Details

#callObject



13
14
15
# File 'lib/motion_sprites/interactions/contexts/create_with_image_in_rectangle_bounds_context.rb', line 13

def call
  @klass.create_image_sprite_with_rectangle_bounds @sprite, @rectangle
end