Class: RmagickTidy::Scope

Inherits:
Object
  • Object
show all
Defined in:
lib/rmagick_tidy/registry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeScope

Returns a new instance of Scope.



5
6
7
8
# File 'lib/rmagick_tidy/registry.rb', line 5

def initialize
  @images = []
  @keeps = {}.compare_by_identity
end

Instance Attribute Details

#imagesObject (readonly)

Returns the value of attribute images.



3
4
5
# File 'lib/rmagick_tidy/registry.rb', line 3

def images
  @images
end

#keepsObject (readonly)

Returns the value of attribute keeps.



3
4
5
# File 'lib/rmagick_tidy/registry.rb', line 3

def keeps
  @keeps
end

Instance Method Details

#keep(image) ⇒ Object



14
15
16
# File 'lib/rmagick_tidy/registry.rb', line 14

def keep(image)
  @keeps[image] = true
end

#keep?(image) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/rmagick_tidy/registry.rb', line 18

def keep?(image)
  @keeps.key?(image)
end

#register(image) ⇒ Object



10
11
12
# File 'lib/rmagick_tidy/registry.rb', line 10

def register(image)
  @images << image
end