Class: Whitestone::Assertion::Custom::Config
- Defined in:
- lib/whitestone/custom_assertions.rb
Overview
Whitestone::Assertion::Custom::Config
The Config object is what makes each custom assertion different. For example (same as the example given in Custom):
name = :circle
description = "Circle equality"
parameters = [ [:circle, Circle], [:values, Array] ]
run_block = lambda { ... }
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#run_block ⇒ Object
readonly
Returns the value of attribute run_block.
Instance Method Summary collapse
-
#initialize(name, hash) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(name, hash) ⇒ Config
Returns a new instance of Config.
64 65 66 67 68 69 |
# File 'lib/whitestone/custom_assertions.rb', line 64 def initialize(name, hash) @name = name @description = hash[:description] @parameters = hash[:parameters] @run_block = hash[:run] end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
63 64 65 |
# File 'lib/whitestone/custom_assertions.rb', line 63 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
63 64 65 |
# File 'lib/whitestone/custom_assertions.rb', line 63 def name @name end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
63 64 65 |
# File 'lib/whitestone/custom_assertions.rb', line 63 def parameters @parameters end |
#run_block ⇒ Object (readonly)
Returns the value of attribute run_block.
63 64 65 |
# File 'lib/whitestone/custom_assertions.rb', line 63 def run_block @run_block end |