Class: Aubergine::Device
- Inherits:
-
Struct
- Object
- Struct
- Aubergine::Device
- Defined in:
- lib/aubergine/device.rb
Instance Attribute Summary collapse
-
#enable ⇒ Object
Returns the value of attribute enable.
-
#ip ⇒ Object
Returns the value of attribute ip.
-
#login ⇒ Object
Returns the value of attribute login.
-
#password ⇒ Object
Returns the value of attribute password.
-
#vendor ⇒ Object
Returns the value of attribute vendor.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#enable ⇒ Object
Returns the value of attribute enable
2 3 4 |
# File 'lib/aubergine/device.rb', line 2 def enable @enable end |
#ip ⇒ Object
Returns the value of attribute ip
2 3 4 |
# File 'lib/aubergine/device.rb', line 2 def ip @ip end |
#login ⇒ Object
Returns the value of attribute login
2 3 4 |
# File 'lib/aubergine/device.rb', line 2 def login @login end |
#password ⇒ Object
Returns the value of attribute password
2 3 4 |
# File 'lib/aubergine/device.rb', line 2 def password @password end |
#vendor ⇒ Object
Returns the value of attribute vendor
2 3 4 |
# File 'lib/aubergine/device.rb', line 2 def vendor @vendor end |
Class Method Details
.build(hash) ⇒ Object
3 4 5 |
# File 'lib/aubergine/device.rb', line 3 def self.build(hash) new(hash[:ip], hash[:vendor], hash[:login], hash[:password], hash[:enable]) end |
Instance Method Details
#to_json(*a) ⇒ Object
13 14 15 |
# File 'lib/aubergine/device.rb', line 13 def to_json(*a) to_map.to_json(*a) end |
#to_map ⇒ Object
7 8 9 10 11 |
# File 'lib/aubergine/device.rb', line 7 def to_map map = Hash.new self.members.each { |m| map[m] = self[m] if self[m] } map end |