Class: SciolyFF::Interpreter::Model
- Inherits:
-
Object
- Object
- SciolyFF::Interpreter::Model
- Defined in:
- lib/sciolyff/interpreter/model.rb
Overview
Parent class for other nested classes within Interpreter
Direct Known Subclasses
Instance Attribute Summary collapse
-
#tournament ⇒ Object
readonly
Returns the value of attribute tournament.
Instance Method Summary collapse
-
#initialize(rep, index) ⇒ Model
constructor
A new instance of Model.
-
#inspect ⇒ Object
prevents infinite loop due caused by intentional circular references.
- #link_to_other_models(interpreter) ⇒ Object
Constructor Details
#initialize(rep, index) ⇒ Model
Returns a new instance of Model.
6 7 8 |
# File 'lib/sciolyff/interpreter/model.rb', line 6 def initialize(rep, index) @rep = rep[pluralize_for_key(self.class)][index] end |
Instance Attribute Details
#tournament ⇒ Object (readonly)
Returns the value of attribute tournament.
14 15 16 |
# File 'lib/sciolyff/interpreter/model.rb', line 14 def tournament @tournament end |
Instance Method Details
#inspect ⇒ Object
prevents infinite loop due caused by intentional circular references
17 18 19 |
# File 'lib/sciolyff/interpreter/model.rb', line 17 def inspect to_s.delete_suffix('>') + " @rep=#{@rep}>" end |
#link_to_other_models(interpreter) ⇒ Object
10 11 12 |
# File 'lib/sciolyff/interpreter/model.rb', line 10 def link_to_other_models(interpreter) @tournament = interpreter.tournament end |