Class: MixinBot::Monitor::AppMessage
- Inherits:
-
Object
- Object
- MixinBot::Monitor::AppMessage
- Defined in:
- lib/mixin_bot/monitor.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#project ⇒ Object
Returns the value of attribute project.
-
#status ⇒ Object
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(project: nil, status: 0, data: []) ⇒ AppMessage
constructor
A new instance of AppMessage.
- #marshal ⇒ Object
Constructor Details
#initialize(project: nil, status: 0, data: []) ⇒ AppMessage
Returns a new instance of AppMessage.
11 12 13 14 15 |
# File 'lib/mixin_bot/monitor.rb', line 11 def initialize(project: nil, status: 0, data: []) @project = project @status = status @data = data end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
9 10 11 |
# File 'lib/mixin_bot/monitor.rb', line 9 def data @data end |
#project ⇒ Object
Returns the value of attribute project.
9 10 11 |
# File 'lib/mixin_bot/monitor.rb', line 9 def project @project end |
#status ⇒ Object
Returns the value of attribute status.
9 10 11 |
# File 'lib/mixin_bot/monitor.rb', line 9 def status @status end |
Class Method Details
.load(yaml_str) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/mixin_bot/monitor.rb', line 17 def self.load(yaml_str) h = YAML.safe_load(yaml_str, permitted_classes: [Symbol], aliases: true) new( project: h['project'], status: h['status'] || 0, data: Array(h['data']) ) end |
Instance Method Details
#marshal ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/mixin_bot/monitor.rb', line 26 def marshal YAML.dump( 'project' => project, 'status' => status, 'data' => data ) end |