Class: Kaiseki::SetVar
- Inherits:
-
PackageParser
- Object
- BasicParser
- PackageParser
- Kaiseki::SetVar
- Defined in:
- lib/var_set.rb
Instance Attribute Summary collapse
-
#vars ⇒ Object
readonly
Returns the value of attribute vars.
Attributes inherited from BasicParser
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean (also: #==)
-
#initialize(expected, *vars) ⇒ SetVar
constructor
A new instance of SetVar.
Methods inherited from PackageParser
Methods inherited from BasicParser
Methods included from Parseable
#&, #action, #and?, #cast, #filter, #merge, #not!, #one_or_more, #optional, #override, #parse, #predicate?, #protect, #repeat, #set, #skip, #tag_error, #tag_result, #to_parseable, #validate, #zero_or_more, #|
Constructor Details
#initialize(expected, *vars) ⇒ SetVar
Returns a new instance of SetVar.
5 6 7 8 9 |
# File 'lib/var_set.rb', line 5 def initialize expected, *vars super expected @vars = [] vars.each {|n| @vars << n } end |
Instance Attribute Details
#vars ⇒ Object (readonly)
Returns the value of attribute vars.
3 4 5 |
# File 'lib/var_set.rb', line 3 def vars @vars end |
Instance Method Details
#eql?(other) ⇒ Boolean Also known as: ==
11 12 13 |
# File 'lib/var_set.rb', line 11 def eql? other other.is_a?(self.class) and other.expected == @expected and other.vars == @vars end |