Class: RmagickTidy::Scope
- Inherits:
-
Object
- Object
- RmagickTidy::Scope
- Defined in:
- lib/rmagick_tidy/registry.rb
Instance Attribute Summary collapse
-
#images ⇒ Object
readonly
Returns the value of attribute images.
-
#keeps ⇒ Object
readonly
Returns the value of attribute keeps.
Instance Method Summary collapse
-
#initialize ⇒ Scope
constructor
A new instance of Scope.
- #keep(image) ⇒ Object
- #keep?(image) ⇒ Boolean
- #register(image) ⇒ Object
Constructor Details
#initialize ⇒ Scope
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
#images ⇒ Object (readonly)
Returns the value of attribute images.
3 4 5 |
# File 'lib/rmagick_tidy/registry.rb', line 3 def images @images end |
#keeps ⇒ Object (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
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 |