Class: EightBall::Conditions::List
- Defined in:
- lib/eight_ball/conditions/list.rb
Overview
The List Condition describes a list of acceptable values. These can be strings, integers, etc.
Instance Attribute Summary collapse
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ List
constructor
Creates a new instance of a List Condition.
- #satisfied?(value) ⇒ Boolean
Methods inherited from Base
Constructor Details
#initialize(options = {}) ⇒ List
Creates a new instance of a List Condition.
19 20 21 22 23 24 |
# File 'lib/eight_ball/conditions/list.rb', line 19 def initialize( = {}) ||= {} @values = Array([:values]) self.parameter = [:parameter] end |
Instance Attribute Details
#values ⇒ Object (readonly)
Returns the value of attribute values.
7 8 9 |
# File 'lib/eight_ball/conditions/list.rb', line 7 def values @values end |
Instance Method Details
#satisfied?(value) ⇒ Boolean
31 32 33 |
# File 'lib/eight_ball/conditions/list.rb', line 31 def satisfied?(value) values.include? value end |