Class: RZabbix::Base
- Inherits:
-
Object
show all
- Defined in:
- lib/rzabbix/base.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(attributes) ⇒ Base
Returns a new instance of Base.
20
21
22
23
|
# File 'lib/rzabbix/base.rb', line 20
def initialize(attributes)
super()
self.attributes = self.class.default_attributes.merge(attributes)
end
|
Instance Attribute Details
#attributes ⇒ Object
18
19
20
|
# File 'lib/rzabbix/base.rb', line 18
def attributes
@attributes
end
|
Instance Method Details
#[](key) ⇒ Object
25
26
27
|
# File 'lib/rzabbix/base.rb', line 25
def [](key)
self.attributes[key.to_sym]
end
|
#to_hash ⇒ Object
33
34
35
|
# File 'lib/rzabbix/base.rb', line 33
def to_hash
self.attributes
end
|
#to_json(*args) ⇒ Object
29
30
31
|
# File 'lib/rzabbix/base.rb', line 29
def to_json(*args)
self.attributes.to_json(*args)
end
|