Class: RedCard::Engine

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

Instance Method Summary collapse

Constructor Details

#initialize(engine, candidate) ⇒ Engine

Returns a new instance of Engine.



3
4
5
6
# File 'lib/redcard/engine.rb', line 3

def initialize(engine, candidate)
  @engine = engine.to_s
  @candidate = candidate.to_s
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


8
9
10
11
12
13
14
15
# File 'lib/redcard/engine.rb', line 8

def valid?
  case @engine
  when "rbx"
    @candidate == "rbx" or @candidate == "rubinius"
  else
    @candidate == @engine
  end
end