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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 63148eb03b8316fe5f758396ba96a9a267333932
4
- data.tar.gz: d77f32a1d6505c0b31cecdd2de962fbdb3a99c70
3
+ metadata.gz: 972986c3c276d7231d644ad79e88fb5d7377a57b
4
+ data.tar.gz: 0bbd0f02ead2edcb7fd4736d8776237d71552888
5
5
  SHA512:
6
- metadata.gz: a9b84cbf47c1847f5de7318a7c37cbe3f2d901d2fc03256d5121ce6fa22e2ad89f96b4dde78e9b4e246d9d7dcf03dd3e48921f47de3d5ebfd6ccf56a5690144c
7
- data.tar.gz: f8066cad306e3ec587ea7d6a4ac566e1926c1c6a092b35032f8eb87bca2771bbd1b5ee6090479d0f45ef1aac630be3411eb70510e26d70ebdbe10e9d415c514c
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
@@ -1,3 +1,3 @@
1
1
  module Rooftop
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.4.1"
3
3
  end
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-02-02 00:00:00.000000000 Z
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.5.1
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