class StairMaster::Conditions::Base
Attributes
method_name[RW]
type[R]
Public Class Methods
new(step, type, method_name)
click to toggle source
# File lib/stair_master/conditions/base.rb, line 11 def initialize(step, type, method_name) @step = step @type = type @method_name = method_name end
Public Instance Methods
description()
click to toggle source
Methods ——————————————
# File lib/stair_master/conditions/base.rb, line 19 def description raise NotImplementedError end
test(context)
click to toggle source
# File lib/stair_master/conditions/base.rb, line 23 def test(context) case @type.to_sym when :if return context.send(@method_name.to_sym) when :unless return !context.send(@method_name.to_sym) else return false end end