wolf_core 0.1.80 → 0.1.82

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da9921ce6c80a5f8eda1e4eb5902e987deb6e8203460c450e34a2d42f61748f7
4
- data.tar.gz: b16b4942decf529b1beb9b1a521923b065134f84690b63cfc25c92f680f5af8a
3
+ metadata.gz: 23473c2b309abb30732eeeb899af9f028cdd040f9e7ad7a2d7af060248d49d3b
4
+ data.tar.gz: a9c390678c164da149a21163b3a139ad49368e9e48ecc69580db24bedaf86892
5
5
  SHA512:
6
- metadata.gz: 1f28624e070f4d6f5943f14977bcf80c1e3787a8420798a32a6349ff2a0607b37f0dfce11f347e7bd2b20c0fae6200115ff51568e5195625d7029557ee7b4de4
7
- data.tar.gz: 58bfaa27cb3a2bd62105c061c78d58612a312c3b3be38565ba521461be37c1aa3eba575aad43e9973689e3ee0442b315e00b6de0f27985e9c2f9435615d24233
6
+ metadata.gz: 11b90e14e12f07bfcf09f148950bde91509a508f16928baf8427ba24d9510f38633a5cbc73e4bff8720f3a501f53c7947cacf1092c3b3bb5460b5917e8d891c1
7
+ data.tar.gz: 77f4b387b06f286a04766b6c4c45052411953a88cc32dd6ba98645c410a4009508878612eadedcff91724867a4065b7d59dd5c0cd8fc5eb5fe3ef7b7fc49247b
@@ -0,0 +1,27 @@
1
+ module WolfCore
2
+ module NoSqlDbDataSource
3
+ module_function
4
+
5
+ def init(region: 'us-east-1')
6
+ @@dynamodb_client ||= Aws::DynamoDB::Client.new(region: region)
7
+ end
8
+
9
+ def instance
10
+ @@dynamodb_client
11
+ end
12
+
13
+ def put_item(table_name:, item:)
14
+ instance.put_item({
15
+ table_name: table_name,
16
+ item: item
17
+ })
18
+ end
19
+
20
+ def get_item(table_name:, key:)
21
+ instance.get_item({
22
+ table_name: table_name,
23
+ key: key
24
+ }).item
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,17 @@
1
+ module WolfCore
2
+ module NoSqlDbOperations
3
+ def put_no_sql_item(table_name:, item:)
4
+ WolfCore::NoSqlDbDataSource.put_item(
5
+ table_name: table_name,
6
+ item: item,
7
+ )
8
+ end
9
+
10
+ def get_no_sql_item(table_name:, key:)
11
+ WolfCore::NoSqlDbDataSource.get_item(
12
+ table_name: table_name,
13
+ key: key,
14
+ )
15
+ end
16
+ end
17
+ end
@@ -4,5 +4,11 @@ module WolfCore
4
4
  return if str.nil?
5
5
  str.gsub(/([A-Z])/, ' \1').strip.downcase.capitalize
6
6
  end
7
+
8
+ def clean_phone_number(phone)
9
+ cleaned_phone = phone.gsub(/\D/, '')
10
+ last_ten_digits = cleaned_phone[-10, 10]
11
+ last_ten_digits
12
+ end
7
13
  end
8
14
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WolfCore
4
- VERSION = "0.1.80"
4
+ VERSION = "0.1.82"
5
5
  end
data/lib/wolf_core.rb CHANGED
@@ -7,6 +7,7 @@ require 'active_support'
7
7
  require 'active_support/core_ext'
8
8
  require 'aws-sdk-lambda'
9
9
  require 'redis'
10
+ require 'aws-sdk-dynamodb'
10
11
 
11
12
  module WolfCore; end
12
13
 
@@ -14,4 +15,5 @@ require 'wolf_core/utils/file_utils'
14
15
 
15
16
  WolfCore::FileUtils.require_relative_folder(__dir__, 'wolf_core')
16
17
  WolfCore::LambdaFunctionDataSource.init
17
- WolfCore::InMemoryStorageDataSource.init
18
+ WolfCore::InMemoryStorageDataSource.init
19
+ WolfCore::NoSqlDbDataSource.init
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wolf_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.80
4
+ version: 0.1.82
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Roncallo
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: aws-sdk-dynamodb
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  description: Repository to store shared code among Ruby projects.
70
84
  email:
71
85
  - jroncallo96@gmail.com
@@ -88,6 +102,8 @@ files:
88
102
  - lib/wolf_core/infrastructure/in_memory_storage_operations.rb
89
103
  - lib/wolf_core/infrastructure/lambda_function_data_source.rb
90
104
  - lib/wolf_core/infrastructure/lambda_function_operations.rb
105
+ - lib/wolf_core/infrastructure/no_sql_db_data_source.rb
106
+ - lib/wolf_core/infrastructure/no_sql_db_operations.rb
91
107
  - lib/wolf_core/utils/array_utils.rb
92
108
  - lib/wolf_core/utils/async_utils.rb
93
109
  - lib/wolf_core/utils/file_utils.rb
@@ -117,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
133
  - !ruby/object:Gem::Version
118
134
  version: '0'
119
135
  requirements: []
120
- rubygems_version: 3.5.14
136
+ rubygems_version: 3.5.18
121
137
  signing_key:
122
138
  specification_version: 4
123
139
  summary: Repository to store shared code among Ruby projects.