Class: Whitestone::Assertion::Custom::Config

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#descriptionObject (readonly)

Returns the value of attribute description.



63
64
65
# File 'lib/whitestone/custom_assertions.rb', line 63

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name.



63
64
65
# File 'lib/whitestone/custom_assertions.rb', line 63

def name
  @name
end

#parametersObject (readonly)

Returns the value of attribute parameters.



63
64
65
# File 'lib/whitestone/custom_assertions.rb', line 63

def parameters
  @parameters
end

#run_blockObject (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