funneler 1.0.1 → 1.1.0

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
  SHA1:
3
- metadata.gz: 880aa82cecc26ab6df5c7a41625912a754581fe1
4
- data.tar.gz: 163ec38d0b55d418d96a6b922706aaf1a109edc8
3
+ metadata.gz: 7a3bf09541da9e35cff85dda980d8e997359390b
4
+ data.tar.gz: a1ddccb9db1fe53ee2deca111f870da829f192ab
5
5
  SHA512:
6
- metadata.gz: 4a92f2ffde57b6a756699bb8842e2fabd99083f5eb46c5c16341acf17ffad426c430d7642db85b4ee412e949f58d13611a9df0846c3633232543732d445fb104
7
- data.tar.gz: cbd8d719e15c1db8d7b333e027e60c384f0cf527ce47acc8df7056d2917ece1582fbd99b90ba25fe57a90869e2060c6325e8a7925b7f81d72cf836c70e1b41ee
6
+ metadata.gz: a8a83dc3f510b91358e01ed93e9db539f82f15008585d50fa83bd0ee172c9883ec254c80813462ae50ca5378bbdf8901b8dbada1936c429293e06ac6c8c69b6c
7
+ data.tar.gz: cfdf91dbc145f71d3159c454d72713ce48a616841a80dfdf5cf5ac2ffe0d1378b84b20d92eaa2b3a4260bd33995657451b17680f9d71bfd9fd79c0b16047bd8a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- funneler (1.0.1)
4
+ funneler (1.1.0)
5
5
  jwt
6
6
 
7
7
  GEM
data/lib/funneler.rb CHANGED
@@ -30,14 +30,17 @@ module Funneler
30
30
  raise InvalidTokenError, "Invalid token '#{token}': #{e.message}"
31
31
  end
32
32
 
33
- def build(route_generator:, params: {}, expires_in_days: nil)
33
+ def build(route_generator:, params: {}, expires_in_days: nil, meta: {})
34
34
  Funneler::FunnelFactory.build(route_generator: route_generator,
35
35
  params: params,
36
+ meta: meta,
36
37
  expires_in_days: expires_in_days)
37
38
  end
38
39
 
39
- def from_routes(routes: {})
40
- Funnel.new('routes' => routes, 'current_page_index' => 0)
40
+ def from_routes(routes: {}, meta: {})
41
+ Funnel.new('routes' => routes,
42
+ 'current_page_index' => 0,
43
+ 'meta' => meta)
41
44
  end
42
45
 
43
46
  def from_url(url:)
@@ -31,6 +31,10 @@ module Funneler
31
31
  @url_cache[current_page_index]
32
32
  end
33
33
 
34
+ def meta
35
+ data['meta'] || {}
36
+ end
37
+
34
38
  def current_page_index
35
39
  data.fetch('current_page_index', 0)
36
40
  end
@@ -76,4 +80,3 @@ module Funneler
76
80
  end
77
81
  end
78
82
  end
79
-
@@ -2,11 +2,13 @@ module Funneler
2
2
  class FunnelFactory
3
3
 
4
4
  class << self
5
- def build(route_generator:, params: {}, expires_in_days: nil)
5
+ def build(route_generator:, params: {}, expires_in_days: nil, meta: {})
6
6
  return nil unless route_generator.respond_to?(:call)
7
7
 
8
8
  routes = route_generator.call(params)
9
- Funnel.new('routes' => routes, 'expires_in_days' => expires_in_days)
9
+ Funnel.new('routes' => routes,
10
+ 'expires_in_days' => expires_in_days,
11
+ 'meta' => meta)
10
12
  end
11
13
  end
12
14
  end
@@ -1,3 +1,3 @@
1
1
  module Funneler
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: funneler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Stawarz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-08 00:00:00.000000000 Z
11
+ date: 2016-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jwt