Class: EasyPing::Model::Abstract
- Inherits:
-
Object
- Object
- EasyPing::Model::Abstract
- Defined in:
- lib/easy_ping/model.rb
Instance Attribute Summary collapse
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(values = {}) ⇒ Abstract
constructor
A new instance of Abstract.
Constructor Details
#initialize(values = {}) ⇒ Abstract
Returns a new instance of Abstract.
141 142 143 144 145 146 |
# File 'lib/easy_ping/model.rb', line 141 def initialize(values={}) @values = values @values.each do |key, value| self.instance_variable_set("@#{key}".to_sym, value) end end |
Instance Attribute Details
#values ⇒ Object (readonly)
Returns the value of attribute values.
139 140 141 |
# File 'lib/easy_ping/model.rb', line 139 def values @values end |
Instance Method Details
#[](key) ⇒ Object
148 149 150 |
# File 'lib/easy_ping/model.rb', line 148 def [](key) values[key.to_s] end |