Permalink
Browse files

Fixing the return value from Mapper#mapping

  • Loading branch information...
1 parent 8fb6e32 commit 53829152c642d7b91a1185ac14ab93ecd8a77192 @andrewtimberlake andrewtimberlake committed Mar 9, 2012
Showing with 6 additions and 5 deletions.
  1. +1 −0 .gitignore
  2. +5 −5 lib/map_fields/mapper.rb
View
1 .gitignore
@@ -2,3 +2,4 @@ pkg/
tmp/
coverage/
map_fields*.gem
+log/
View
10 lib/map_fields/mapper.rb
@@ -22,13 +22,17 @@ def initialize(controller, fields, file)
@rows = map_fields(controller, params.delete(:mapped_fields), @fields)
end
end
- attr_reader :rows, :fields, :params, :mapping, :ignore_first_row
+ attr_reader :rows, :fields, :params, :ignore_first_row
def error!
@mapped = false
@rows = parse_first_few_lines @controller.session[:map_fields_file]
end
+ def mapping
+ @mapping['mapping']
+ end
+
def mapped?
@mapped
end
@@ -51,10 +55,6 @@ def each(&block)
@rows.each &block
end
- def [](key)
- @mapping[key]
- end
-
def file
@controller.session[:map_fields_file]
end

0 comments on commit 5382915

Please sign in to comment.