Class: Easymon::ActiveRecordMysqlWriteableCheck
- Inherits:
-
Object
- Object
- Easymon::ActiveRecordMysqlWriteableCheck
- Defined in:
- lib/easymon/checks/active_record_mysql_writeable_check.rb
Instance Attribute Summary collapse
-
#klass ⇒ Object
Returns the value of attribute klass.
Instance Method Summary collapse
- #check ⇒ Object
-
#initialize(klass) ⇒ ActiveRecordMysqlWriteableCheck
constructor
A new instance of ActiveRecordMysqlWriteableCheck.
Constructor Details
#initialize(klass) ⇒ ActiveRecordMysqlWriteableCheck
Returns a new instance of ActiveRecordMysqlWriteableCheck.
5 6 7 8 |
# File 'lib/easymon/checks/active_record_mysql_writeable_check.rb', line 5 def initialize(klass) self.klass = klass @query = "SELECT @@read_only for UPDATE" end |
Instance Attribute Details
#klass ⇒ Object
Returns the value of attribute klass.
3 4 5 |
# File 'lib/easymon/checks/active_record_mysql_writeable_check.rb', line 3 def klass @klass end |
Instance Method Details
#check ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/easymon/checks/active_record_mysql_writeable_check.rb', line 10 def check check_status = database_writeable? if check_status = "@@read_only is 0" else = "@@read_only is 1" end [check_status, ] end |