Class: SourceMonitor::Configuration::ValidationDefinition
- Inherits:
-
Object
- Object
- SourceMonitor::Configuration::ValidationDefinition
- Defined in:
- lib/source_monitor/configuration/validation_definition.rb
Instance Attribute Summary collapse
-
#handler ⇒ Object
readonly
Returns the value of attribute handler.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(handler, options) ⇒ ValidationDefinition
constructor
A new instance of ValidationDefinition.
- #signature ⇒ Object
- #symbol? ⇒ Boolean
Constructor Details
#initialize(handler, options) ⇒ ValidationDefinition
Returns a new instance of ValidationDefinition.
8 9 10 11 |
# File 'lib/source_monitor/configuration/validation_definition.rb', line 8 def initialize(handler, ) @handler = handler @options = end |
Instance Attribute Details
#handler ⇒ Object (readonly)
Returns the value of attribute handler.
6 7 8 |
# File 'lib/source_monitor/configuration/validation_definition.rb', line 6 def handler @handler end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/source_monitor/configuration/validation_definition.rb', line 6 def @options end |
Instance Method Details
#signature ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/source_monitor/configuration/validation_definition.rb', line 13 def signature handler_key = case handler when Symbol [ :symbol, handler ] when String [ :symbol, handler.to_sym ] else [ :callable, handler.object_id ] end [ handler_key, ] end |
#symbol? ⇒ Boolean
27 28 29 |
# File 'lib/source_monitor/configuration/validation_definition.rb', line 27 def symbol? handler.is_a?(Symbol) || handler.is_a?(String) end |