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 +4 -4
- data/lib/fern/api.rb +4 -1
- data/lib/fern/api/endpoint.rb +11 -0
- data/lib/fern/api/version.rb +1 -1
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19721635a12a3849db3ef7dcb7bc35672ea8debd
|
4
|
+
data.tar.gz: 7a801ad72725610d2e3bb5c38f2bc595d73b18fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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[
|
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
|
data/lib/fern/api/endpoint.rb
CHANGED
@@ -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
|
data/lib/fern/api/version.rb
CHANGED
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.
|
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:
|
14
|
+
name: minitest
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
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: '
|
26
|
+
version: '5.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
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: '
|
40
|
+
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
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:
|
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.
|
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.
|
99
|
+
rubygems_version: 2.6.14
|
100
100
|
signing_key:
|
101
101
|
specification_version: 4
|
102
102
|
summary: Fern API
|