rom-mapper 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Changelog.md ADDED
@@ -0,0 +1,9 @@
1
+ # v0.1.1 2013-09-02
2
+
3
+ * [internal] Moved version file to rom/mapper/version (solnic)
4
+
5
+ [Compare v0.1.0..v0.1.1](https://github.com/rom-rb/rom-mapper/compare/v0.1.0...v0.1.1)
6
+
7
+ # v0.1.0 2013-08-23
8
+
9
+ First public release
data/config/reek.yml CHANGED
@@ -23,8 +23,6 @@ FeatureEnvy:
23
23
  exclude:
24
24
  - ROM::Mapper::Loader::Allocator#call
25
25
  - ROM::Mapper::Loader::AttributeWriter#call
26
- - ROM::Mapper::Loader::ObjectBuilder#attributes
27
- - ROM::Mapper::Header#mapping
28
26
  IrresponsibleModule:
29
27
  enabled: true
30
28
  exclude: []
@@ -15,6 +15,11 @@ module ROM
15
15
  new(mapping || field.name, field)
16
16
  end
17
17
 
18
+ # @api private
19
+ def mapping
20
+ { tuple_key => name }
21
+ end
22
+
18
23
  # @api private
19
24
  def tuple_key
20
25
  field.name
@@ -32,7 +32,7 @@ module ROM
32
32
  # @api private
33
33
  def mapping
34
34
  each_with_object({}) { |attribute, hash|
35
- hash[attribute.tuple_key] = attribute.name
35
+ hash.update attribute.mapping
36
36
  }
37
37
  end
38
38
  memoize :mapping
@@ -63,6 +63,13 @@ module ROM
63
63
  attributes.fetch(name)
64
64
  end
65
65
 
66
+ # Return attribute names
67
+ #
68
+ # @api private
69
+ def attribute_names
70
+ map(&:name)
71
+ end
72
+
66
73
  # Iterate over attributes
67
74
  #
68
75
  # @api private
@@ -18,7 +18,7 @@ module ROM
18
18
 
19
19
  # @api private
20
20
  def attributes(tuple)
21
- Hash[header.map { |attribute| [attribute.name, tuple[attribute.name]] }]
21
+ Hash[header.attribute_names.map { |name| [name, tuple[name]] }]
22
22
  end
23
23
 
24
24
  end # ObjectBuilder
@@ -1,11 +1,9 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module ROM
4
-
5
4
  class Mapper
6
5
 
7
- VERSION = '0.1.0'.freeze
6
+ VERSION = '0.1.1'.freeze
8
7
 
9
8
  end # Mapper
10
-
11
9
  end # ROM
data/rom-mapper.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
- require File.expand_path('../lib/rom/version', __FILE__)
3
+ require File.expand_path('../lib/rom/mapper/version', __FILE__)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "rom-mapper"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rom-mapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-23 00:00:00.000000000 Z
12
+ date: 2013-09-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: concord
@@ -102,6 +102,7 @@ files:
102
102
  - .ruby-gemset
103
103
  - .ruby-version
104
104
  - .travis.yml
105
+ - Changelog.md
105
106
  - Gemfile
106
107
  - Gemfile.devtools
107
108
  - Guardfile
@@ -123,7 +124,7 @@ files:
123
124
  - lib/rom/mapper/loader/allocator.rb
124
125
  - lib/rom/mapper/loader/attribute_writer.rb
125
126
  - lib/rom/mapper/loader/object_builder.rb
126
- - lib/rom/version.rb
127
+ - lib/rom/mapper/version.rb
127
128
  - rom-mapper.gemspec
128
129
  - spec/shared/unit/loader_call.rb
129
130
  - spec/shared/unit/loader_identity.rb