Class: Sapristi::Monitor
- Inherits:
-
Object
- Object
- Sapristi::Monitor
- Defined in:
- lib/sapristi/monitor.rb
Constant Summary collapse
- ATTRIBUTES =
%i[id main name x y offset_x offset_y work_area work_area_width work_area_height].freeze
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #[](key) ⇒ Object
- #hash ⇒ Object
-
#initialize(data) ⇒ Monitor
constructor
A new instance of Monitor.
Constructor Details
#initialize(data) ⇒ Monitor
Returns a new instance of Monitor.
5 6 7 |
# File 'lib/sapristi/monitor.rb', line 5 def initialize(data) data.each { |key, value| instance_variable_set "@#{key}".to_sym, value } end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
21 22 23 |
# File 'lib/sapristi/monitor.rb', line 21 def ==(other) other.class == self.class && state == other.state end |
#[](key) ⇒ Object
9 10 11 |
# File 'lib/sapristi/monitor.rb', line 9 def [](key) instance_variable_get "@#{key}" end |
#hash ⇒ Object
17 18 19 |
# File 'lib/sapristi/monitor.rb', line 17 def hash state.hash end |