class Aubergine::Device

Public Class Methods

build(hash) click to toggle source
# File lib/aubergine/device.rb, line 3
def self.build(hash)
  new(hash[:ip], hash[:vendor], hash[:login], hash[:password], hash[:enable])
end

Public Instance Methods

to_json(*a) click to toggle source
# File lib/aubergine/device.rb, line 13
def to_json(*a)
  to_map.to_json(*a)
end
to_map() click to toggle source
# 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