Class: Compilator::CompilatorModel

Inherits:
Druzy::MVC::Model
  • Object
show all
Defined in:
lib/compilator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCompilatorModel



70
71
72
73
74
75
76
77
78
79
80
# File 'lib/compilator.rb', line 70

def initialize
  super()
  @score = {'r' => 0, 'o' => 1, 'j' => 2, 'c' => 3, 'v' => 4, 'e' => 5}
  @last_key_pressed = nil
  @result = nil
  @raz = false
  @delete = false
  @result_total = nil
  @result_arrondi = nil
  @raz_total
end

Instance Attribute Details

#calculatriceObject

Returns the value of attribute calculatrice.



67
68
69
# File 'lib/compilator.rb', line 67

def calculatrice
  @calculatrice
end

#deleteObject

Returns the value of attribute delete.



67
68
69
# File 'lib/compilator.rb', line 67

def delete
  @delete
end

#last_key_pressedObject

Returns the value of attribute last_key_pressed.



67
68
69
# File 'lib/compilator.rb', line 67

def last_key_pressed
  @last_key_pressed
end

#resultObject

Returns the value of attribute result.



67
68
69
# File 'lib/compilator.rb', line 67

def result
  @result
end

#scoreObject

Returns the value of attribute score.



67
68
69
# File 'lib/compilator.rb', line 67

def score
  @score
end

#totalObject

Returns the value of attribute total.



67
68
69
# File 'lib/compilator.rb', line 67

def total
  @total
end

Instance Method Details

#raz=(raz) ⇒ Object



92
93
94
95
# File 'lib/compilator.rb', line 92

def raz=(raz)
  old, @raz = @raz, raz
  fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,"raz",old,@raz))
end

#raz_total=(raz_total) ⇒ Object



112
113
114
115
# File 'lib/compilator.rb', line 112

def raz_total=(raz_total)
  old, @raz_total = @raz_total, raz_total
  fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,'raz_total',old,@raz_total))
end

#result_arrondi=(result_arrondi) ⇒ Object



107
108
109
110
# File 'lib/compilator.rb', line 107

def result_arrondi=(result_arrondi)
  old, @result_arrondi = @result_arrondi, result_arrondi
  fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,'result_arrondi',old,@result_arrondi))
end

#result_total=(result_total) ⇒ Object



102
103
104
105
# File 'lib/compilator.rb', line 102

def result_total=(result_total)
  old, @result_total = @result_total, result_total
  fire_property_change(Druzy::MVC::PropertyChangeEvent.new(self,'result_total',old,@result_total))
end