Class: EightBall::Conditions::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/eight_ball/conditions/base.rb

Direct Known Subclasses

Always, List, Never, Range

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_options = []) ⇒ Base

Returns a new instance of Base.



7
8
9
# File 'lib/eight_ball/conditions/base.rb', line 7

def initialize(_options = [])
  @parameter = nil
end

Instance Attribute Details

#parameterObject

Returns the value of attribute parameter.



5
6
7
# File 'lib/eight_ball/conditions/base.rb', line 5

def parameter
  @parameter
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



15
16
17
# File 'lib/eight_ball/conditions/base.rb', line 15

def ==(other)
  other.class == self.class && other.state == state
end

#hashObject



20
21
22
# File 'lib/eight_ball/conditions/base.rb', line 20

def hash
  state.hash
end

#satisfied?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/eight_ball/conditions/base.rb', line 11

def satisfied?
  raise 'You can never satisfy the Base condition'
end