Class: Passwordstate::Resources::Host

Inherits:
Passwordstate::Resource show all
Defined in:
lib/passwordstate/resources/host.rb

Instance Attribute Summary

Attributes inherited from Passwordstate::Resource

#client

Class Method Summary collapse

Methods inherited from Passwordstate::Resource

acceptable_methods, all, api_path, #attributes, #delete, delete, #get, get, index_field, #initialize, nil_as_string, passwordstate_to_ruby_field, passwordstateify_hash, post, #post, #pretty_print, put, #put, ruby_to_passwordstate_field, #stored?

Constructor Details

This class inherits a constructor from Passwordstate::Resource

Class Method Details

.available?(client) ⇒ Boolean

Returns:

  • (Boolean)


38
39
40
41
42
43
44
45
# File 'lib/passwordstate/resources/host.rb', line 38

def self.available?(client)
  client.request :get, api_path
  true
rescue Passwordstate::NotFoundError
  true
rescue Passwordstate::ForbiddenError
  false
end