nasp 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89880614b8d999ceee56075251768167fb7880e4
4
- data.tar.gz: 43970d59f67485fdda299ad2a8341521e9e6e388
3
+ metadata.gz: ea7571ada4cb4f1bd3ccc5273d3a221823f18fd3
4
+ data.tar.gz: 7adf512439f3da2db1fa610b095d962bcf332c73
5
5
  SHA512:
6
- metadata.gz: c99597b8cc7d457e7ec7a8fe624019ce0375564af91580d0d611f9b16936875e21c27c19660a857af879d39ee57c5603f18c8f87ebe256c0bed42e561b2a88e7
7
- data.tar.gz: c01242db5ff777a8d4359891a6a821cd31b16c8c87dfa2953099c0d661f680968154c956ced2b2aabda00b71ee22f7c77b1309c5979c2cfb13d032e834de548d
6
+ metadata.gz: 374f3480b0d6fc8521f4737e22a0a9de874102fed03e1320247a0d19c20e646e11391d180ee72b12ae478e2adcbcf2c37610d41a11c1b66f6cb408cb1b4005ad
7
+ data.tar.gz: cf48c778f3e270f06834d110c78ea9461ebe45f9b4742a4711b6750c3e9826f1ce52942a4035c271da18e7c998f494eeeca3bc5e23172f0bbb88be665a7247ce
@@ -4,8 +4,22 @@ require 'nasp/instruction_query'
4
4
 
5
5
  module Nasp
6
6
  class << self
7
- attr_accessor :production_key, :production_token,
8
- :sandbox_key, :sandbox_token,
9
- :environment
7
+ attr_accessor :production_key, :production_token, :sandbox_key, :sandbox_token, :environment
8
+
9
+ def key
10
+ send(:"#{environment}_key")
11
+ end
12
+
13
+ def token
14
+ send(:"#{environment}_token")
15
+ end
16
+
17
+ def ensure_key_and_token_set!
18
+ if Nasp.key.blank?
19
+ raise StandardError, "Invalid Nasp.#{environment}_key set."
20
+ elsif Nasp.token.blank?
21
+ raise StandardError, "Invalid Nasp.#{environment}_token set."
22
+ end
23
+ end
10
24
  end
11
25
  end
@@ -1,3 +1,3 @@
1
1
  module Nasp
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nasp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cirdes Borges Henrique Filho
@@ -53,7 +53,7 @@ files:
53
53
  - lib/nasp/.DS_Store
54
54
  - lib/nasp/instruction_query.rb
55
55
  - lib/nasp/version.rb
56
- - nasp-0.0.2.gem
56
+ - nasp-0.0.3.gem
57
57
  - nasp.gemspec
58
58
  homepage: https://github.com/eventick/nasp
59
59
  licenses:
Binary file