Class: Duse::Client::CreateSecret

Inherits:
Object
  • Object
show all
Defined in:
lib/duse/client/secret.rb

Defined Under Namespace

Classes: CreatableSecret

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ CreateSecret

Returns a new instance of CreateSecret.



69
70
71
72
73
74
75
# File 'lib/duse/client/secret.rb', line 69

def initialize(options)
  @title = options.fetch(:title)
  @secret_text = options.fetch(:secret_text)
  @users = options.fetch(:users)
  @folder_id = options.fetch(:folder_id, nil)
  @folder_id = @folder_id.to_i if !@folder_id.nil?
end

Class Method Details

.with(options) ⇒ Object



65
66
67
# File 'lib/duse/client/secret.rb', line 65

def self.with(options)
  new(options)
end

Instance Method Details

#sign_with(private_key) ⇒ Object



77
78
79
80
81
82
83
84
85
# File 'lib/duse/client/secret.rb', line 77

def sign_with(private_key)
  CreatableSecret.new(
    title: @title,
    secret_text: @secret_text,
    users: @users,
    private_key: private_key,
    folder_id: @folder_id
  )
end