atlas 1.2.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/atlas/box.rb +1 -0
- data/lib/atlas/box_provider.rb +1 -0
- data/lib/atlas/box_version.rb +1 -0
- data/lib/atlas/resource.rb +18 -0
- data/lib/atlas/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af11e09114885b35e7d35e684f2075699ee52816
|
4
|
+
data.tar.gz: a0e9ac3d3cbef2031ae55c711ca4aee3186cc250
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 488a6879bb4629a2820268a124f13e63632b71e7665c9576c5db0a6e8794f3dcfb8fb0d2224df3ab5f09ca363936dd88e6f270a6da18ca3ba9280d369e4b96a1
|
7
|
+
data.tar.gz: 173b901038c488a629642c3da3c1e615931f88b097ea56db3248dd7097873c3d5cd875f4159085a387f6f434fbd52746f8a0cbb1fb315cfa6e6a763f3a2c5110
|
data/CHANGELOG.md
CHANGED
data/lib/atlas/box.rb
CHANGED
data/lib/atlas/box_provider.rb
CHANGED
data/lib/atlas/box_version.rb
CHANGED
data/lib/atlas/resource.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require "date"
|
2
|
+
|
1
3
|
module Atlas
|
2
4
|
# Base class for representing resources.
|
3
5
|
class Resource
|
@@ -29,5 +31,21 @@ module Atlas
|
|
29
31
|
objects = to_hash.map { |k, v| "#{k}=#{v.inspect}" }.join(' ')
|
30
32
|
"#<#{self.class.name}:#{object_id} #{objects}>"
|
31
33
|
end
|
34
|
+
|
35
|
+
class << self
|
36
|
+
def date_writer(*args)
|
37
|
+
args.each do |attr|
|
38
|
+
define_method("#{attr}=".to_sym) do |date|
|
39
|
+
date = date.is_a?(String) ? DateTime.parse(date) : date
|
40
|
+
instance_variable_set("@#{attr}", date)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def date_accessor(*args)
|
46
|
+
attr_reader(*args)
|
47
|
+
date_writer(*args)
|
48
|
+
end
|
49
|
+
end
|
32
50
|
end
|
33
51
|
end
|
data/lib/atlas/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atlas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Charlton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|