simple_cells 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/simple_cells/base_cell.rb +14 -0
- data/lib/simple_cells/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5eb75ec2524d174c575dfe53c75590c04b79dfbb
|
4
|
+
data.tar.gz: b8411a8e5796b88982f1caf9c86ed4fee421bae7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9e0edc86fd4cd732c857dafcacae549351160464aee7eb935d810ce0b8ddeae61a4130ff90fdab76cd1ba959f6ce74aebf68a8cdce035688d7bbf4b27fa8ee3
|
7
|
+
data.tar.gz: 4f3c4202f5016b29703824a956327ed8f03c10f78cfd5be4c0b126a88f36c5a694af5257f65b4bfe1bc7316e26cf8113c7b32a65a7672cae7289a4e96b9872d6
|
@@ -1,4 +1,6 @@
|
|
1
1
|
class SimpleCells::BaseCell
|
2
|
+
include Rails.application.routes.url_helpers
|
3
|
+
|
2
4
|
def initialize(args)
|
3
5
|
@_simple_cell_arguments = args.fetch(:simple_cell_arguments)
|
4
6
|
@_simple_cell_view_context = args.fetch(:view_context)
|
@@ -39,6 +41,10 @@ class SimpleCells::BaseCell
|
|
39
41
|
@_simple_cell_arguments[key] = value
|
40
42
|
end
|
41
43
|
|
44
|
+
def params
|
45
|
+
@_simple_cell_view_context.params
|
46
|
+
end
|
47
|
+
|
42
48
|
def render(args)
|
43
49
|
@_simple_cell_view_to_render = args
|
44
50
|
end
|
@@ -51,6 +57,14 @@ class SimpleCells::BaseCell
|
|
51
57
|
@_simple_cell_arguments
|
52
58
|
end
|
53
59
|
|
60
|
+
def t(key)
|
61
|
+
if key.start_with?(".")
|
62
|
+
I18n.t("simple_cells.#{cell_name}#{key}")
|
63
|
+
else
|
64
|
+
I18n.t(key)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
54
68
|
def view_context
|
55
69
|
@_simple_cell_view_context
|
56
70
|
end
|
data/lib/simple_cells/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_cells
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kaspernj
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
206
|
version: '0'
|
207
207
|
requirements: []
|
208
208
|
rubyforge_project:
|
209
|
-
rubygems_version: 2.
|
209
|
+
rubygems_version: 2.2.2
|
210
210
|
signing_key:
|
211
211
|
specification_version: 4
|
212
212
|
summary: An attempt at writing a very simple cells gem.
|