Class: Exemplor::Check

Inherits:
Object
  • Object
show all
Defined in:
lib/checker.rb

Direct Known Subclasses

Assert, Show

Instance Method Summary collapse

Constructor Details

#initialize(name, value) ⇒ Check

Returns a new instance of Check.



4
5
6
7
# File 'lib/checker.rb', line 4

def initialize(name, value)
  @name  = name
  @value = value
end

Instance Method Details

#[](disambiguate) ⇒ Object



9
10
11
12
# File 'lib/checker.rb', line 9

def [](disambiguate)
  @disambiguate = disambiguate
  self
end

#failure?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/checker.rb', line 26

def failure?
  status == :failure
end

#info?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/checker.rb', line 30

def info?
  status == :info
end

#is(arg) ⇒ Object



18
19
20
# File 'lib/checker.rb', line 18

def is(arg)
  warn "Check().is() doesn't assert anymore, use Assert()"
end

#nameObject



14
15
16
# File 'lib/checker.rb', line 14

def name
  @name + (defined?(@disambiguate) ? " #{@disambiguate}" : '')
end

#success?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/checker.rb', line 22

def success?
  status == :success
end