rackr 0.0.57 → 0.0.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rackr/action.rb +4 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 817c73cfeca9d09f9bba0002c6bc19b34d5b6bcc0299a24a3e9bb87b075c12b5
4
- data.tar.gz: e1c4710e34bf53a780a7d6b132469151fc2e4fafaf8a27205266414a02ac7299
3
+ metadata.gz: 5014c37c092dde5f043f96ff04bef8c53fdd9bc2df76233a23a0a8dd957be3f1
4
+ data.tar.gz: 0cab424f6b8edb7f5e12ea2cfd05c7ac00be0df6c240affaacb57df2ca972040
5
5
  SHA512:
6
- metadata.gz: 63ff89e8f20793339587a042e626ab483ff524a21b90195e0b28e00c02a9e741b665b306fe30f07e05e0d7922b4ec6f6064bda8a019b0b6e0daf32cdd7a17be6
7
- data.tar.gz: a308d0fe7e5df0c9d69ed789338bb7ded223b48c05bfac49230d588ee5b926dbb73473c4aadd1690594025779d82ba46b06a71b6b0577acf3b3bd712d1446ecf
6
+ metadata.gz: 7664d3fa655aea2dcbde6b9456bfd2e6ea0c2876cf47d060cc808519276b8e8e7244493360a2912449573fc422c15390a4afbe201c90c46311879065e9b4227a
7
+ data.tar.gz: 1582549edba2bbca7dca30635106faed13cf28b01ef6941b31ebe745711494d91fab86ce3d4a76e115e56f9a5a141e73860a4f67ab3fc7b6836342d1a255363a
data/lib/rackr/action.rb CHANGED
@@ -7,7 +7,7 @@ require 'rack'
7
7
 
8
8
  class Rackr
9
9
  module Action
10
- METHODS = {
10
+ RENDER = {
11
11
  html: lambda do |val, **opts|
12
12
  [opts[:status] || 200, { 'content-type' => 'text/html' }.merge(opts[:headers] || {}), [val]]
13
13
  end,
@@ -31,9 +31,10 @@ class Rackr
31
31
  end
32
32
 
33
33
  def render(**opts)
34
- type, content = opts.first
34
+ type = opts.keys.first
35
+ content = opts[type]
35
36
 
36
- METHODS[type]&.(content, **opts) || _render_view(content, **opts)
37
+ Rackr::Action::RENDER[type]&.(content, **opts) || _render_view(content, **opts)
37
38
  end
38
39
 
39
40
  def view_response(
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rackr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.57
4
+ version: 0.0.58
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henrique F. Teixeira