collector 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -6,11 +6,11 @@ TODO: Write a gem description
6
6
 
7
7
  Add this line to your application's Gemfile:
8
8
 
9
- gem 'collector'
9
+ gem "collector"
10
10
 
11
11
  And then execute:
12
12
 
13
- $ bundle
13
+ $ bundle install
14
14
 
15
15
  Or install it yourself as:
16
16
 
@@ -16,4 +16,6 @@ Gem::Specification.new do |gem|
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ["lib"]
19
+
20
+ gem.add_dependency "activesupport", "~> 3.2.8"
19
21
  end
@@ -1,3 +1,5 @@
1
+ require "active_support/core_ext/hash/keys"
2
+
1
3
  module Collector
2
4
  module Model
3
5
 
@@ -6,14 +8,14 @@ module Collector
6
8
  end
7
9
 
8
10
  def initialize(attributes = {})
11
+ attributes.symbolize_keys!
12
+
9
13
  attributes.each do |attribute, value|
10
14
  send("#{attribute}=", value) if methods.include? "#{attribute}=".to_sym
11
15
  end
12
16
 
13
- created_at = attributes["created_at"] || attributes[:created_at]
14
- updated_at = attributes["updated_at"] || attributes[:updated_at]
15
- instance_variable_set("@created_at", created_at) if created_at
16
- instance_variable_set("@updated_at", updated_at) if updated_at
17
+ instance_variable_set("@created_at", attributes[:created_at]) if attributes[:created_at]
18
+ instance_variable_set("@updated_at", attributes[:updated_at]) if attributes[:updated_at]
17
19
  end
18
20
 
19
21
  def touch
@@ -1,3 +1,3 @@
1
1
  module Collector
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: collector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,8 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-03 00:00:00.000000000 Z
13
- dependencies: []
12
+ date: 2012-11-06 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: activesupport
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 3.2.8
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 3.2.8
14
30
  description: An implementation of the Repository Pattern
15
31
  email:
16
32
  - brandon@anti-pattern.com