Class: Test

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, name) ⇒ Test

Returns a new instance of Test.



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

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



2
3
4
# File 'lib/test.rb', line 2

def name
  @name
end

#statusObject (readonly)

Returns the value of attribute status.



2
3
4
# File 'lib/test.rb', line 2

def status
  @status
end

Instance Method Details

#==(another_test) ⇒ Object



13
14
15
16
17
# File 'lib/test.rb', line 13

def ==(another_test)
  fields_used_for_comparison.inject(true) do |acc, m|
    acc && instance_variable_get("@#{m}") == another_test.send(m)
  end
end

#passed?Boolean

Returns:

  • (Boolean)


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

def passed?
  @status
end