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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9510806b02f56aefe87490e1d0d55a3322ead98d
4
- data.tar.gz: b0dac1a496bf9ac9f532a441aca60eb9d745d5f8
3
+ metadata.gz: 5eb75ec2524d174c575dfe53c75590c04b79dfbb
4
+ data.tar.gz: b8411a8e5796b88982f1caf9c86ed4fee421bae7
5
5
  SHA512:
6
- metadata.gz: 20d520f12656c6d07578ba067bf323eff1aa1b3860e761dd48bd08f1fb18bc103f1b3709829225c9ba5219031d698e3d1a2f40358e6771c60a238a36ecaf2701
7
- data.tar.gz: 89e9cd9ac75cdaf845343204e505581e0f749ee238697334bf026a87f539da7386fd8998e0c940ca3198951d4d20708736772a175615c198325dc5eb55d6fc85
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
@@ -1,3 +1,3 @@
1
1
  module SimpleCells
2
- VERSION = "0.0.2".freeze
2
+ VERSION = "0.0.3".freeze
3
3
  end
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.2
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-04-28 00:00:00.000000000 Z
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.4.0
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.