Module: NetStatus::Hash::Mixin

Defined in:
lib/net_status/hash.rb

Instance Method Summary collapse

Instance Method Details

#net_status_error?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/net_status/hash.rb', line 8

def net_status_error?
  not net_status_ok?
end

#net_status_normalize(**kwargs) ⇒ Object



4
5
6
# File 'lib/net_status/hash.rb', line 4

def net_status_normalize(**kwargs)
  NetStatus.normalize(self, **kwargs)
end

#net_status_ok!Object



16
17
18
19
# File 'lib/net_status/hash.rb', line 16

def net_status_ok!
  raise NetStatus::Exception, self unless net_status_ok?
  self
end

#net_status_ok?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/net_status/hash.rb', line 12

def net_status_ok?
  !(key? :error)
end