rooftop 0.1.4 → 0.1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rooftop/resource_links/link.rb +13 -0
- data/lib/rooftop/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: 972986c3c276d7231d644ad79e88fb5d7377a57b
|
4
|
+
data.tar.gz: 0bbd0f02ead2edcb7fd4736d8776237d71552888
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a55186a6be1fb54306783b8d46db739db1bbfe4524117cd65251bcde4a72d0c71f711efb41b15cffb26767e63e473cee3dc635cee8a48a6ea04a096b69ca378a
|
7
|
+
data.tar.gz: cdbb0998f50444b7e4ffa4bf70cdd00e33abce15c6c7c6f8f1cf86d340a5c46cd9f0632b10c9d7992fc0ed2069af9b2223e153fa6f670b308c2b8d9e1ca90c3f
|
@@ -2,12 +2,25 @@ module Rooftop
|
|
2
2
|
module ResourceLinks
|
3
3
|
class Link < ::OpenStruct
|
4
4
|
attr_accessor :link_type
|
5
|
+
|
5
6
|
def initialize(link_type,args, klass=nil)
|
6
7
|
@link_type = link_type
|
7
8
|
@mapped_class = klass.try(:resource_link_mapping).try(:[],@link_type)
|
9
|
+
@klass = klass
|
10
|
+
|
8
11
|
super(args)
|
9
12
|
end
|
10
13
|
|
14
|
+
def marshal_dump
|
15
|
+
[@link_type, @table, @klass]
|
16
|
+
end
|
17
|
+
|
18
|
+
def marshal_load(array)
|
19
|
+
@link_type = array[0]
|
20
|
+
@table = array[1]
|
21
|
+
@klass = array[2]
|
22
|
+
end
|
23
|
+
|
11
24
|
def resolve(klass=nil)
|
12
25
|
# We need to figure out what we're going to instantiate. If it's in the resource link mapping, use that. If not, try the klass passed into the resolve() method. Failing that, make an attempt to constantize something; otherwise we're going to have to raise
|
13
26
|
@mapped_class ||= klass || @link_type.camelize.classify.constantize
|
data/lib/rooftop/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rooftop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.4
|
4
|
+
version: 0.1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ed Jones
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -172,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
172
172
|
version: '0'
|
173
173
|
requirements: []
|
174
174
|
rubyforge_project:
|
175
|
-
rubygems_version: 2.
|
175
|
+
rubygems_version: 2.4.8
|
176
176
|
signing_key:
|
177
177
|
specification_version: 4
|
178
178
|
summary: An ActiveRecord-like interface to the Rooftop CMS JSON API
|