class EightBall::Conditions::Base
Attributes
parameter[R]
Public Class Methods
new(_options = [])
click to toggle source
# File lib/eight_ball/conditions/base.rb, line 7 def initialize(_options = []) @parameter = nil end
Public Instance Methods
==(other)
click to toggle source
# File lib/eight_ball/conditions/base.rb, line 15 def ==(other) other.class == self.class && other.state == state end
Also aliased as: eql?
hash()
click to toggle source
# File lib/eight_ball/conditions/base.rb, line 20 def hash state.hash end
satisfied?()
click to toggle source
# File lib/eight_ball/conditions/base.rb, line 11 def satisfied? raise 'You can never satisfy the Base condition' end
Protected Instance Methods
parameter=(parameter)
click to toggle source
# File lib/eight_ball/conditions/base.rb, line 30 def parameter=(parameter) return if parameter.nil? @parameter = parameter.gsub(/(.)([A-Z])/, '\1_\2').downcase end
state()
click to toggle source
# File lib/eight_ball/conditions/base.rb, line 26 def state [@parameter] end