fern-api 0.0.6 → 0.0.7

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: 41fbd75c6e06e6f6ad81071060b134ee8d16376d
4
- data.tar.gz: d8e4743dbed7572ec410e05df30868f398d5d843
3
+ metadata.gz: 19721635a12a3849db3ef7dcb7bc35672ea8debd
4
+ data.tar.gz: 7a801ad72725610d2e3bb5c38f2bc595d73b18fb
5
5
  SHA512:
6
- metadata.gz: b3e59c0b2e98731a603799ad47f694caabedc7bf7be43d25475f3f0883c128eb7c2484321f7e1dca23dc9fc85c52d5574aa64787e53ff34421226903e825cee4
7
- data.tar.gz: c5b566d13f292a7de52d20250fbb19c23ce467c75c79f5d7b53b5d6915d1008a94383a4fb5c72e312ca0a14be36a2b2495018bb3a36607af6141ec27a24798b8
6
+ metadata.gz: bc9a1a395974ab27d2ea6d3f875a920f0279b4a264508032310d6f38005818ecb208b8e49374be0c511f386a24eb56ab3796eed588e518d46a2a9700d97f8636
7
+ data.tar.gz: f8c2163acb73d055af581d62b50f57190aebb4e238e3f2a95ac638c699c9fb223df0f5a56b6a133337ee4c189e1e84898de4f248331c9cb8c56db0c5e4489600
data/lib/fern/api.rb CHANGED
@@ -4,11 +4,14 @@ module Fern
4
4
  module Api
5
5
  extend ActiveSupport::Concern
6
6
 
7
- VERBS = %i[delete connect get head options patch post put trace].freeze
7
+ VERBS = %i[get head post patch put delete options].freeze
8
8
 
9
9
  included do
10
10
  class_eval { class_attribute :fern }
11
11
  self.fern = {}
12
+ def present(obj)
13
+ render json: obj
14
+ end
12
15
  end
13
16
 
14
17
  class_methods do
@@ -11,6 +11,17 @@ module Fern
11
11
  def request(&block)
12
12
  @controller.send(:define_method, @name, &block)
13
13
  end
14
+
15
+ def form(key = nil, klass)
16
+ @controller.fern[@name][:form] = {
17
+ key: key,
18
+ klass: klass
19
+ }
20
+ end
21
+
22
+ def presenter(klass)
23
+ @controller.fern[@name][:presenter] = klass
24
+ end
14
25
  end
15
26
  end
16
27
  end
@@ -1,5 +1,5 @@
1
1
  module Fern
2
2
  module Api
3
- VERSION = '0.0.6'.freeze
3
+ VERSION = '0.0.7'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fern-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Kestell
@@ -11,35 +11,35 @@ cert_chain: []
11
11
  date: 2017-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rake
14
+ name: minitest
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '10.0'
19
+ version: '5.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '10.0'
26
+ version: '5.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: minitest
28
+ name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '5.0'
33
+ version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '5.0'
40
+ version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: activesupport
42
+ name: actionpack
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '5.0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: actionpack
56
+ name: activesupport
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
@@ -88,7 +88,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - ">="
90
90
  - !ruby/object:Gem::Version
91
- version: 2.0.0
91
+ version: 2.3.0
92
92
  required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ">="
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  version: '0'
97
97
  requirements: []
98
98
  rubyforge_project:
99
- rubygems_version: 2.6.11
99
+ rubygems_version: 2.6.14
100
100
  signing_key:
101
101
  specification_version: 4
102
102
  summary: Fern API