static_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.
- data/lib/static_struct.rb +5 -1
- metadata +9 -7
- checksums.yaml +0 -7
data/lib/static_struct.rb
CHANGED
@@ -8,6 +8,10 @@ class StaticStruct
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def method_missing(mid, *args)
|
11
|
+
if args.size > 0
|
12
|
+
raise "Can't assign or create attribute #{mid} because StaticStruct is immutable."
|
13
|
+
end
|
14
|
+
|
11
15
|
value_of(mid)
|
12
16
|
end
|
13
17
|
|
@@ -25,7 +29,7 @@ class StaticStruct
|
|
25
29
|
|
26
30
|
def ==(other)
|
27
31
|
return false unless(other.is_a?(StaticStruct))
|
28
|
-
return
|
32
|
+
return self.to_h == other.to_h
|
29
33
|
end
|
30
34
|
|
31
35
|
def to_h
|
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: static_struct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Federico Poli
|
@@ -10,7 +11,7 @@ bindir: bin
|
|
10
11
|
cert_chain: []
|
11
12
|
date: 2013-02-18 00:00:00.000000000 Z
|
12
13
|
dependencies: []
|
13
|
-
description: This library allows the creation of
|
14
|
+
description: This library allows the creation of immutable objects from a hash.
|
14
15
|
email:
|
15
16
|
- fapoli@gmail.com
|
16
17
|
executables: []
|
@@ -20,25 +21,26 @@ files:
|
|
20
21
|
- lib/static_struct.rb
|
21
22
|
homepage: http://github.com/fapoli/static-struct
|
22
23
|
licenses: []
|
23
|
-
metadata: {}
|
24
24
|
post_install_message:
|
25
25
|
rdoc_options: []
|
26
26
|
require_paths:
|
27
27
|
- lib
|
28
28
|
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
29
30
|
requirements:
|
30
|
-
- - '>='
|
31
|
+
- - ! '>='
|
31
32
|
- !ruby/object:Gem::Version
|
32
33
|
version: '0'
|
33
34
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
none: false
|
34
36
|
requirements:
|
35
|
-
- - '>='
|
37
|
+
- - ! '>='
|
36
38
|
- !ruby/object:Gem::Version
|
37
39
|
version: '0'
|
38
40
|
requirements: []
|
39
41
|
rubyforge_project:
|
40
|
-
rubygems_version:
|
42
|
+
rubygems_version: 1.8.24
|
41
43
|
signing_key:
|
42
|
-
specification_version:
|
44
|
+
specification_version: 3
|
43
45
|
summary: Static Struct
|
44
46
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 6768ae197cb8c203a3f6656d488acacc5e953e62
|
4
|
-
data.tar.gz: 442a882a531bb1e45bbb61614738a970d59d6462
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 8a17dda252ffbe28bd65db51555ba91db181181450be96ea59ce909b19fb1e4a6dba953637a044e215bd699a76676e78c073fcaa1fc2d916342c08df68a14aef
|
7
|
-
data.tar.gz: 3ca29f06dbbb9f2c52ae27aa67b49eecb69e75fecc0bf30f29700ac98905e6ff3842f388f3cba972df8ed3d55327ff1c043a1ddfcebf1e12ded3dfd66d052c98
|