padiddler 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
@@ -10,7 +10,7 @@ Maniuplate hashes from an external source so they work for your database setup.
10
10
 
11
11
  Add this line to your application's Gemfile:
12
12
 
13
- gem 'paddiddler'
13
+ gem 'padiddler'
14
14
 
15
15
  ## Usage
16
16
 
@@ -32,7 +32,8 @@ Second, define your Diddler for the input
32
32
  keep :first_name, :last_name
33
33
 
34
34
  # these instance variable should be renamed in the output
35
- rename :phone => :tel_no
35
+ # in this case, the input key 'tel_no' will be called 'phone' in the output.
36
+ rename :tel_no => :phone
36
37
 
37
38
  # this additional output should be added
38
39
  add :date_of_birth do
@@ -33,7 +33,7 @@ module Padiddler
33
33
  private
34
34
 
35
35
  # create a name accessor for an instance variable
36
- def instance_variable_accessor(var_name, name)
36
+ def instance_variable_accessor(name, var_name)
37
37
  instance_var = instance_variable_name(var_name)
38
38
  define_method(name) { instance_variable_get(instance_var) }
39
39
  end
@@ -1,3 +1,3 @@
1
1
  module Padiddler
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -38,14 +38,14 @@ describe Padiddler::Base do
38
38
 
39
39
  describe 'rename' do
40
40
  it 'should take a hash and define instance methods' do
41
- SampleDiddler.rename(:first_name => :firstname)
41
+ SampleDiddler.rename(:firstname => :first_name)
42
42
  diddler = SampleDiddler.new
43
43
  expect(diddler).to respond_to(:first_name)
44
44
  expect(diddler).not_to respond_to(:firstname)
45
45
  end
46
46
 
47
47
  it 'should return the instance referred to in the value of the key value pair' do
48
- SampleDiddler.rename(:first_name => :firstname)
48
+ SampleDiddler.rename(:firstname => :first_name)
49
49
  diddler = SampleDiddler.new
50
50
  diddler.instance_variable_set(:@firstname, 'Jeremiah')
51
51
  expect(diddler.first_name).to eq('Jeremiah')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: padiddler
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,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-27 00:00:00.000000000 Z
12
+ date: 2014-01-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler