intercept 0.2.2 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +2 -2
- data/lib/intercept/decorator/add_suffix.rb +1 -1
- data/lib/intercept/decorator/replace.rb +27 -0
- data/lib/intercept/strategy/replace.rb +1 -1
- data/lib/intercept/version.rb +1 -1
- data/lib/intercept/worker.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca86bc01920dbdf85af943a201225d6d316efe711639a5e1e3f3058cba2b1685
|
4
|
+
data.tar.gz: 58671f0ffd90c86202091627edd3e89336d1733877f27891360ce12b41e6d9d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36418ca96ec020040d43a46f240513b13e2569601764d097f9e30ffa2b4dcac4f83f8cbe5e032d29f3c10dc940628c9ee5e63b92ac9d4115df1f1787d391a79d
|
7
|
+
data.tar.gz: 40e1d6d483720e14b149ae531cfcf808a075823f4671bf8e095cd9168df642ce6daabb11434dfb86101d922bbc38f3637a78858d352dce4021c756d172061e2d
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# Intercept
|
2
2
|
|
3
|
-
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/intercept.svg)](https://badge.fury.io/rb/intercept) [![Maintainability](https://api.codeclimate.com/v1/badges/89e9e742466987d05bf4/maintainability)](https://codeclimate.com/github/GeminPatel/intercept/maintainability)
|
4
4
|
|
5
|
-
|
5
|
+
Intercept and modify ruby objects with publisher-subscriber pattern
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Intercept
|
4
|
+
module Decorator
|
5
|
+
class Replace
|
6
|
+
attr_reader :replace_value
|
7
|
+
|
8
|
+
def initialize(replace_value)
|
9
|
+
@replace_value = parse_replace_value replace_value
|
10
|
+
end
|
11
|
+
|
12
|
+
def decorate(_)
|
13
|
+
replace_value.call
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def parse_replace_value(replace_value)
|
19
|
+
if replace_value.respond_to?(:call)
|
20
|
+
replace_value
|
21
|
+
else
|
22
|
+
raise '@param replace_value must respond to #call'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/intercept/version.rb
CHANGED
data/lib/intercept/worker.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: intercept
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gemin Patel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -73,6 +73,7 @@ files:
|
|
73
73
|
- intercept.gemspec
|
74
74
|
- lib/intercept.rb
|
75
75
|
- lib/intercept/decorator/add_suffix.rb
|
76
|
+
- lib/intercept/decorator/replace.rb
|
76
77
|
- lib/intercept/decorator_builder.rb
|
77
78
|
- lib/intercept/strategy/mapper.rb
|
78
79
|
- lib/intercept/strategy/replace.rb
|