Class: Magick::Targeting::Role

Inherits:
Base
  • Object
show all
Defined in:
lib/magick/targeting/role.rb

Instance Method Summary collapse

Constructor Details

#initialize(role_name) ⇒ Role

Returns a new instance of Role.



6
7
8
# File 'lib/magick/targeting/role.rb', line 6

def initialize(role_name)
  @role_name = role_name.to_s
end

Instance Method Details

#matches?(context) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/magick/targeting/role.rb', line 10

def matches?(context)
  context[:role]&.to_s == @role_name
end