Class: Lastpass::Collection Private

Inherits:
Object
  • Object
show all
Defined in:
lib/lastpass-api/collection.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Represents a collection of Lastpass objects (whether that be accounts or groups)

Direct Known Subclasses

Accounts, Groups

Instance Method Summary collapse

Instance Method Details

#find(search_text, with_password: false) ⇒ Hash, NilClass

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Find a specific object by name or by ID

Parameters:

  • search_text (String)

    Object name or ID

  • with_password (Boolean) (defaults to: false)

    Fetch the password along with the object details (default: false)

Returns:

  • (Hash, NilClass)


13
14
15
# File 'lib/lastpass-api/collection.rb', line 13

def find( search_text, with_password: false )
  show( search_text, with_passwords: with_password )&.first
end

#find_all(search_text = '.*', with_passwords: false) ⇒ Array<Hash>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Note:

By default, with no params specified, all objects will be returned.

Find all objects by name or by ID

Parameters:

  • search_text (String) (defaults to: '.*')

    Object name or ID (can pass in regex like ‘.*’)

  • with_passwords (Boolean) (defaults to: false)

    Fetch the password along with the object details (default: false)

Returns:

  • (Array<Hash>)


23
24
25
# File 'lib/lastpass-api/collection.rb', line 23

def find_all( search_text = '.*', with_passwords: false )
  show( search_text, with_passwords: with_passwords, regex: true ) || []
end