Class: Regressor::Model::Expression
- Inherits:
-
Object
- Object
- Regressor::Model::Expression
- Defined in:
- lib/model/expression.rb
Instance Attribute Summary collapse
-
#expectation ⇒ Object
Returns the value of attribute expectation.
-
#matcher ⇒ Object
Returns the value of attribute matcher.
-
#matcher_expectation ⇒ Object
Returns the value of attribute matcher_expectation.
-
#modification ⇒ Object
Returns the value of attribute modification.
-
#subject ⇒ Object
Returns the value of attribute subject.
Instance Method Summary collapse
-
#initialize(subject, expectation, matcher, matcher_expectation, modification = nil) ⇒ Expression
constructor
A new instance of Expression.
- #to_s ⇒ Object
Constructor Details
#initialize(subject, expectation, matcher, matcher_expectation, modification = nil) ⇒ Expression
Returns a new instance of Expression.
7 8 9 10 11 12 13 |
# File 'lib/model/expression.rb', line 7 def initialize(subject, expectation, matcher, matcher_expectation, modification = nil) self.subject = subject self.expectation = expectation self.matcher = matcher self.matcher_expectation = matcher_expectation self.modification = modification end |
Instance Attribute Details
#expectation ⇒ Object
Returns the value of attribute expectation.
5 6 7 |
# File 'lib/model/expression.rb', line 5 def expectation @expectation end |
#matcher ⇒ Object
Returns the value of attribute matcher.
5 6 7 |
# File 'lib/model/expression.rb', line 5 def matcher @matcher end |
#matcher_expectation ⇒ Object
Returns the value of attribute matcher_expectation.
5 6 7 |
# File 'lib/model/expression.rb', line 5 def matcher_expectation @matcher_expectation end |
#modification ⇒ Object
Returns the value of attribute modification.
5 6 7 |
# File 'lib/model/expression.rb', line 5 def modification @modification end |
#subject ⇒ Object
Returns the value of attribute subject.
5 6 7 |
# File 'lib/model/expression.rb', line 5 def subject @subject end |
Instance Method Details
#to_s ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/model/expression.rb', line 15 def to_s if self.modification.nil? "it { #{self.subject}.#{self.expectation} #{self.matcher}(:#{self.matcher_expectation}) }" else "it { #{self.subject}.#{self.expectation} #{self.matcher}(:#{self.matcher_expectation}).#{self.modification} }" end end |