Class: ComerDeTapas::Subscription

Inherits:
Object
  • Object
show all
Defined in:
lib/comer_de_tapas/subscription.rb

Constant Summary collapse

CredentialYamlNotExist =
Class.new StandardError
CredentialYamlKeyError =
Class.new StandardError
CredentialYamlValueError =
Class.new StandardError

Instance Method Summary collapse

Constructor Details

#initializeSubscription

Returns a new instance of Subscription.



7
8
9
10
11
# File 'lib/comer_de_tapas/subscription.rb', line 7

def initialize
  raise CredentialYamlNotExist, 'Please run `comer_de_tapas init` first' unless File.exist? CREDENTIAL_FILE

  set_subscription_data if subscription_data_valid?
end

Instance Method Details

#to_hHash

Returns User’s Ruby Tapas credential information.

Returns:

  • (Hash)

    User’s Ruby Tapas credential information



14
15
16
# File 'lib/comer_de_tapas/subscription.rb', line 14

def to_h
  { email: email, password: password, save_path: save_path }
end