Skip to content

Commit

Permalink
add to_h
Browse files Browse the repository at this point in the history
  • Loading branch information
swistaczek committed Apr 21, 2013
1 parent 4669b21 commit 3361604
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/network_manager/modem.rb
Expand Up @@ -90,9 +90,11 @@ def send_ussd(message)

def device
{
model: model,
port: @properties[MM_DBUS_INTERFACE_MODEM]['Device'],
unlock_required: @properties[MM_DBUS_INTERFACE_MODEM]['UnlockRequired'],
master_device: @properties[MM_DBUS_INTERFACE_MODEM]['MasterDevice']
master_device: @properties[MM_DBUS_INTERFACE_MODEM]['MasterDevice'],
dbus_path: @bus_path
}
end

Expand All @@ -108,6 +110,17 @@ def inspect
end
end

def to_h
{
imei: imei,
imsi: imsi,
signal: signal,
operator_code: operator_code,
device: device,
status: (enabled? ? :enabled : :disabled )
}
end

class << self
def fetch(paths_array, opts = {})
devices = []
Expand Down

0 comments on commit 3361604

Please sign in to comment.