method_struct 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ .ruby-version
data/README.md CHANGED
@@ -29,8 +29,8 @@ Say you have this:
29
29
 
30
30
  You can change it into this:
31
31
 
32
- class Registrator < MethodStruct.new(:register, :email, :name)
33
- def register
32
+ class Registrator < MethodStruct.new(:email, :name)
33
+ def call
34
34
  create_user!
35
35
  send_email!
36
36
  end
@@ -47,7 +47,7 @@ You can change it into this:
47
47
 
48
48
  class UsersController
49
49
  def create
50
- Registrator.register(params[:email], params[:name])
50
+ Registrator.call(params[:email], params[:name])
51
51
  end
52
52
  end
53
53
 
@@ -3,8 +3,10 @@ require "method_struct/version"
3
3
  module MethodStruct
4
4
  def self.new(*fields)
5
5
  Class.new do
6
- define_singleton_method(:call) do |*field_values|
7
- new(*field_values).call
6
+ class << self
7
+ define_method(:call) do |*field_values|
8
+ new(*field_values).call
9
+ end
8
10
  end
9
11
 
10
12
  define_method(:initialize) do |*values|
@@ -1,3 +1,3 @@
1
1
  module MethodStruct
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,64 +1,76 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: method_struct
3
- version: !ruby/object:Gem::Version
4
- version: 0.0.2
3
+ version: !ruby/object:Gem::Version
4
+ hash: 25
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 3
10
+ version: 0.0.3
5
11
  platform: ruby
6
- authors:
7
- - Paweł Obrok
12
+ authors:
13
+ - "Pawe\xC5\x82 Obrok"
8
14
  autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
- date: 2013-07-15 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2013-07-15 00:00:00 +02:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
14
22
  name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ~>
18
- - !ruby/object:Gem::Version
19
- version: '1.3'
20
- type: :development
21
23
  prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
24
27
  - - ~>
25
- - !ruby/object:Gem::Version
26
- version: '1.3'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ! '>='
32
- - !ruby/object:Gem::Version
33
- version: '0'
28
+ - !ruby/object:Gem::Version
29
+ hash: 9
30
+ segments:
31
+ - 1
32
+ - 3
33
+ version: "1.3"
34
34
  type: :development
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: rake
35
38
  prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ! '>='
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: rspec
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ! '>='
46
- - !ruby/object:Gem::Version
47
- version: '0'
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ hash: 3
45
+ segments:
46
+ - 0
47
+ version: "0"
48
48
  type: :development
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: rspec
49
52
  prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
53
+ requirement: &id003 !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ hash: 3
59
+ segments:
60
+ - 0
61
+ version: "0"
62
+ type: :development
63
+ version_requirements: *id003
55
64
  description: Facilitates extracting methods into separate objects
56
- email:
65
+ email:
57
66
  - pawel.obrok@gmail.com
58
67
  executables: []
68
+
59
69
  extensions: []
70
+
60
71
  extra_rdoc_files: []
61
- files:
72
+
73
+ files:
62
74
  - .gitignore
63
75
  - Gemfile
64
76
  - LICENSE.txt
@@ -68,30 +80,39 @@ files:
68
80
  - lib/method_struct/version.rb
69
81
  - method_struct.gemspec
70
82
  - spec/method_struct_spec.rb
83
+ has_rdoc: true
71
84
  homepage: https://github.com/basecrm/method_struct
72
- licenses:
85
+ licenses:
73
86
  - MIT
74
- metadata: {}
75
87
  post_install_message:
76
88
  rdoc_options: []
77
- require_paths:
89
+
90
+ require_paths:
78
91
  - lib
79
- required_ruby_version: !ruby/object:Gem::Requirement
80
- requirements:
81
- - - ! '>='
82
- - !ruby/object:Gem::Version
83
- version: '0'
84
- required_rubygems_version: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - ! '>='
87
- - !ruby/object:Gem::Version
88
- version: '0'
92
+ required_ruby_version: !ruby/object:Gem::Requirement
93
+ none: false
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ hash: 3
98
+ segments:
99
+ - 0
100
+ version: "0"
101
+ required_rubygems_version: !ruby/object:Gem::Requirement
102
+ none: false
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ hash: 3
107
+ segments:
108
+ - 0
109
+ version: "0"
89
110
  requirements: []
111
+
90
112
  rubyforge_project:
91
- rubygems_version: 2.0.5
113
+ rubygems_version: 1.6.2
92
114
  signing_key:
93
- specification_version: 4
115
+ specification_version: 3
94
116
  summary: Facilitates extracting methods into separate objects
95
- test_files:
117
+ test_files:
96
118
  - spec/method_struct_spec.rb
97
- has_rdoc:
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NzkyNTk3M2ViNGYxMzliMjk4NTJmMDk2MmZmYTFlNmQzMjQ3OTc4OQ==
5
- data.tar.gz: !binary |-
6
- MTYxZjU0M2JlOTYzY2E5MDI4MDU3Y2QyMmI3ZmRjNjJmY2I4ZGJlMA==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- MDFhNWU1YjU2OWU3MTBmZTVhYTNkMmQ1MDk0ZWNmNWU0YTVkYWRkYTU3Mzg0
10
- MWFhMTdlYjM0ZTUyZjVjYTc2MTczMGNjNzY1NTczMTk3ODJkMTcyZjMzYzdj
11
- ODdlZTM2YmZhZTFjNjhmYzI0N2U3MDA4M2I5ZDc3MmRhODQzOWI=
12
- data.tar.gz: !binary |-
13
- YzM1OTMwNWM5OWMyZjJiZWIxMWEzMjY0NDYxNGIwYWI2MDRhYzQ0MTY5YmQ4
14
- Y2RmYWRlZDAwZDBhM2M1NzhlNzcxOTk3NGJhNGM0ZjM3MmJkZTU4ZmMxMjE0
15
- NTM1MmJhYzMwYWU1NGM2NDMyOTQxMTE3NTczMTUxOWU3OWRmNWY=