Class: View
Overview
Visualization of the data that model contains.
Direct Known Subclasses
FenetreApprentissage, FenetreCharger, FenetreJeuLibre, FenetreMenu, FenetreNiveau, FenetreNouvellePartie, FenetrePrincipale, FenetrePseudo, FenetreReglages, FenetreRegles, FenetreScores, FenetreStatistiques
Constant Summary
Constants included from Fenetre
Fenetre::COULEUR_BLANC, Fenetre::COULEUR_BLEU, Fenetre::COULEUR_JAUNE, Fenetre::COULEUR_ORANGE, Fenetre::COULEUR_ROUGE, Fenetre::COULEUR_VERT, Fenetre::FONT_MENU, Fenetre::SIZE_AUTRE_JEU, Fenetre::SIZE_CONTENU_REGLE, Fenetre::SIZE_CONTENU_SCORE, Fenetre::SIZE_CONTENU_STAT, Fenetre::SIZE_LABEL_BOUTON, Fenetre::SIZE_PSEUDO, Fenetre::SIZE_TITRE, Fenetre::SIZE_TITRE_JEU, Fenetre::SIZE_TITRE_REGLAGE, Fenetre::SIZE_TITRE_REGLE, Fenetre::SIZE_TITRE_SCORE, Fenetre::SIZE_TITRE_STAT
Instance Attribute Summary collapse
-
#content ⇒ Object
writeonly
Sets the attribute content.
-
#controller ⇒ Object
Returns the value of attribute controller.
-
#headerBar ⇒ Object
Returns the value of attribute headerBar.
-
#window ⇒ Object
Returns the value of attribute window.
Class Method Summary collapse
-
.inherited(subclass) ⇒ Object
Invoke methods when inherited.
Instance Method Summary collapse
-
#initialize ⇒ View
constructor
A new instance of View.
-
#run ⇒ Object
Invoke all methods from view.
-
#setInstanceVars ⇒ Object
Create instance variables from @content provided by controller.
Methods included from Fenetre
appliquerStyle, boutonAnnuler_barre, boutonMenu_barre, boutonPauseChrono_barre, boutonPlayChrono_barre, boutonQuitter_barre, boutonReinit_barre, boutonRetablir_barre, boutonRetour, boutonSauvegarder_barre, box, creerBarreMenu, creerBoxBottom, creerLabelType, creerPopup, css, detruire, enteteFenetre, fenetre, fenetrePrecedente, fenetrePrecedente=, fenetreStyle, viderFenetre
Constructor Details
#initialize ⇒ View
Returns a new instance of View
15 16 17 18 19 20 |
# File 'app/core/View.rb', line 15 def initialize() @content = Hash.new() @controller = nil @window = Fenetre::fenetre @headerBar = Fenetre::enteteFenetre end |
Instance Attribute Details
#content=(value) ⇒ Object (writeonly)
Sets the attribute content
13 14 15 |
# File 'app/core/View.rb', line 13 def content=(value) @content = value end |
#controller ⇒ Object
Returns the value of attribute controller
12 13 14 |
# File 'app/core/View.rb', line 12 def controller @controller end |
#headerBar ⇒ Object
Returns the value of attribute headerBar
12 13 14 |
# File 'app/core/View.rb', line 12 def headerBar @headerBar end |
#window ⇒ Object
Returns the value of attribute window
12 13 14 |
# File 'app/core/View.rb', line 12 def window @window end |
Class Method Details
.inherited(subclass) ⇒ Object
Invoke methods when inherited
29 30 31 32 33 34 |
# File 'app/core/View.rb', line 29 def self.inherited(subclass) self.new() super return self end |
Instance Method Details
#run ⇒ Object
Invoke all methods from view
50 51 52 53 54 |
# File 'app/core/View.rb', line 50 def run() if Core::DEBUG raise "View #{self.class.name} can't be build because run method is not redefined." end end |
#setInstanceVars ⇒ Object
Create instance variables from @content provided by controller.
40 41 42 43 44 |
# File 'app/core/View.rb', line 40 def setInstanceVars () @content.each { |name, value| instance_variable_set("@" + name, value) } return self end |