super_struct 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/Rakefile +1 -1
- data/lib/super_struct.rb +4 -0
- data/lib/super_struct/version.rb +1 -1
- data/spec/super_struct_spec.rb +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a4ceab883ee25bcae184aff63d37e902e5c7d91
|
4
|
+
data.tar.gz: a272258f3e3d6afb4eb5bf490bd3b1bb13d490eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce9a1c3773fef0b3c47e009edd46cd7022f622e5377e1a8f506bb3324f75ef547fe2b99cf8e4b320220a8ff06e03516140c595355b69a018a84f7732f1702795
|
7
|
+
data.tar.gz: 5dfc2e4f7dcf2ea216cde83dd90d5f0f59c3ebe95ca728c9ef33f84f33bc93faa75263d7e32e497a4a625e53c77d25e7545d8ce78f2e7bac218762c5db9469b6
|
data/README.md
CHANGED
@@ -36,6 +36,10 @@ john_doe = Customer.new(attributes)
|
|
36
36
|
=> #<struct Customer name="John Doe">
|
37
37
|
john_doe.name
|
38
38
|
=> 'John Doe'
|
39
|
+
john_doe.has_attribute?(:name)
|
40
|
+
=> true
|
41
|
+
john_doe.has_attribute?(:dob)
|
42
|
+
=> false
|
39
43
|
```
|
40
44
|
|
41
45
|
## Testing
|
@@ -47,7 +51,7 @@ bundle exec rake spec
|
|
47
51
|
|
48
52
|
## Contributing
|
49
53
|
|
50
|
-
1. Fork it ( https://github.com/
|
54
|
+
1. Fork it ( https://github.com/bramswenson/super_struct/fork )
|
51
55
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
52
56
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
53
57
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/Rakefile
CHANGED
data/lib/super_struct.rb
CHANGED
data/lib/super_struct/version.rb
CHANGED
data/spec/super_struct_spec.rb
CHANGED
@@ -32,6 +32,12 @@ describe SuperStruct do
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
+
describe '::from_hash' do
|
36
|
+
it 'creates a class and instance from the input' do
|
37
|
+
expect(SuperStruct.from_hash(input)).to be_a Struct
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
35
41
|
describe '#new' do
|
36
42
|
context 'given multiple arguments as input' do
|
37
43
|
subject { klass.new(:bar, :bang) }
|