etna 0.1.14 → 0.1.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/etna/user.rb +7 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 21cc63172edb5e8f2745449be1baa675e8cc16caa4e5d2d1163191eafc79f5f2
4
- data.tar.gz: 6dfb21b53cd62988491eed11ab334364ad5151d5e918e46fe41b90ca9204b81c
3
+ metadata.gz: fcca17011305af65656dd4e432613c75738d9a96d1afeb96ff442f1d4b5fc116
4
+ data.tar.gz: a166eb3b9f5f1bcaa3d4a6f8fbae742370bfb8a561a4e766c134f51449fe8292
5
5
  SHA512:
6
- metadata.gz: '08f9025f92c4e32734db6b5f48d470a8c9c051002d73b949aefb7de45fdf091ad416811765a881623cfc4bd13efe6ee7b714f8526f51c8497e8141f48fa36ff0'
7
- data.tar.gz: 7b06ea7b51cc4b580896bb806c64825e21c1d70e47d1ebbfac88678a12770c4aee8a13810a1e617cb8c02bba12b5a28b795887d01de726ea97d6fbaaa6caa469
6
+ metadata.gz: fd1bd5668794b0afb00a99fd39545c24de02677391737caf1c1165562933fe0214f4662b00bf3e7b90b9da05727e11cdc2226103dbdd1ceb6d91223a1e68b766
7
+ data.tar.gz: 1c5dfa81e6151ec5b2f12d546753e970d081f7b462ff839b525bed7ead4d6079fa296acdb330115ecefc20571aea63767b4f76b739434869553f79429cedaf3c
@@ -7,7 +7,9 @@ module Etna
7
7
  }
8
8
 
9
9
  def initialize params, token=nil
10
- @first, @last, @email, @encoded_permissions = params.values_at(:first, :last, :email, :perm)
10
+ @first, @last, @email, @encoded_permissions, encoded_flags = params.values_at(:first, :last, :email, :perm, :flags)
11
+
12
+ @flags = encoded_flags&.split(/;/) || []
11
13
  @token = token unless !token
12
14
  raise ArgumentError, "No email given!" unless @email
13
15
  end
@@ -30,6 +32,10 @@ module Etna
30
32
  end.inject([],:+).to_h
31
33
  end
32
34
 
35
+ def has_flag?(flag)
36
+ @flags.include?(flag)
37
+ end
38
+
33
39
  def name
34
40
  "#{first} #{last}"
35
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: etna
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.14
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saurabh Asthana
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-03 00:00:00.000000000 Z
11
+ date: 2020-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack