easy_init 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzQxYjg0ZTY5MjI3MGRlYTE4MmM3MTgwMjg5NTc3OWFiMmIxZjdlOA==
4
+ NTZhMTExNTk3NGM1ZmE1OTdiNjg1ZGI1OTQ2OGI2MTY5ZDVmYWVmNQ==
5
5
  data.tar.gz: !binary |-
6
- NmIzNmFmYTE0MWYyYWNiMDk3N2U0ODFlNzVjOGY4YzQ2YmRmMjM2Nw==
6
+ MTVmOTU2ZDRmOWJmZjQ3OWNkMzRkNTcwMmI4OGEyNDJhZTY1OTk3Yg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- N2NlYTEwN2ViNGU1Zjc3ZTRkNzc0N2RiZDc3NWEwNjBlNTRmZDNiNTFiZjk4
10
- NjU2ZTc3NTYwMTU2Mjk5ZjlhNWNlYWQ0NjNlZDhlNjRhMDc3ZjFiNGNhZDhj
11
- ODg4YzY1MTQ2NTYyOTdjYzYxNGM4ZDI5ODQ5MmQzOGZlMmNkNTI=
9
+ NTYxNDg3MjYwODFhN2E2ZDU4YzZlZmIwMmFjNTE0MmRkYTI5ODU5ZGMxOWZh
10
+ YTUwYTkxNTY0ZWRmMzg0Y2RiOWNkOTNkYWQxZGI1MzQ1MGFkMjU1YzRmM2I2
11
+ OWRhNGE5YjA0MmQ1ZTQzYjAwYzAxYmU4OTcxMTlkMTNjM2I1ODE=
12
12
  data.tar.gz: !binary |-
13
- NmY4MmVkZThmYTI2OTAzNzQ1NTE1YTdiNjhiNzUwMTNjMDI3ODZlNjBlMjFk
14
- NDQyNTY5NmFhNWU1NjZhMmRhODIzNGRjMzUxOGY1ZWVjYzdmMTQ2M2EzNWYy
15
- NjE3NmExZjJlMGQxYWM2MmIxYzBhZDAxZTVhMTY3NTgxNDNiY2M=
13
+ MDg5MzAzZTQxOGRlYTJiNWMxN2U3ODhmMmUxY2NjMzExYjMxYzliMzNjNTM0
14
+ ODVjODcyMjkzOTllMDhmMzYwMTk2ZDJmYmE2YTM1MDc5NGYyNzk0Njc2ZDU1
15
+ ZGY5ODUzNGZkODk1NzgwOGU1NjdiYWVmY2Q3YjRlNTVmOWJlOGE=
data/README.md CHANGED
@@ -1,9 +1,5 @@
1
1
  # EasyInit
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/easy_init`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
3
  ## Installation
8
4
 
9
5
  Add this line to your application's Gemfile:
@@ -22,7 +18,17 @@ Or install it yourself as:
22
18
 
23
19
  ## Usage
24
20
 
25
- TODO: Write usage instructions here
21
+ ```ruby
22
+ class Foo
23
+ include AccessorInitializable
24
+ attr_accessor :bar, :baz
25
+ end
26
+
27
+ foo = Foo.new({bar: "bar", baz: "baz", quux: "quux"})
28
+ foo.bar # => "bar"
29
+ foo.baz # => "baz"
30
+ foo.quux # NoMethodError: undefined method `quux' for #<Foo:0x007faa822b20a8 @bar="bar", @baz="baz">
31
+ ```
26
32
 
27
33
  ## Development
28
34
 
Binary file
data/easy_init.gemspec CHANGED
@@ -13,9 +13,6 @@ Gem::Specification.new do |spec|
13
13
  spec.description = "Easy Init provides modules that can be included in your project to quickly and easily initialize objects in ruby."
14
14
  spec.homepage = "https://github.com/Heath101/easy_init.git"
15
15
 
16
- # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
17
- # delete this section to allow pushing this gem to any host.
18
-
19
16
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
17
  spec.bindir = "exe"
21
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
@@ -1,7 +1,7 @@
1
1
  module AccessorInitializable
2
- def initialize(attrs)
2
+ def initialize(attrs={})
3
3
  attrs.each do |method,value|
4
4
  public_send("#{method}=",value) if respond_to? "#{method}="
5
5
  end
6
6
  end
7
- end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module EasyInit
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/easy_init.rb CHANGED
@@ -2,5 +2,5 @@ require "easy_init/version"
2
2
  require_relative "accessor_initializable"
3
3
 
4
4
  module EasyInit
5
- # Your code goes here...
5
+
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_init
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Heath Attig
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-06-04 00:00:00.000000000 Z
11
+ date: 2015-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -68,6 +68,7 @@ files:
68
68
  - Rakefile
69
69
  - bin/console
70
70
  - bin/setup
71
+ - easy_init-0.1.0.gem
71
72
  - easy_init.gemspec
72
73
  - lib/accessor_initializable.rb
73
74
  - lib/easy_init.rb