pseudo_object 0.1.0 → 0.1.1
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 +12 -16
- data/lib/pseudo_object/{basic_object.rb → model/basic_object.rb} +22 -8
- data/lib/pseudo_object/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90763d9ad331d2ba6fb3f64585444063ec1a1576
|
4
|
+
data.tar.gz: fce9f859259c9a5fc7e33fe6178bb45471c914a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c998035df3bf327b3559506d4b1ab6e47cd4f974c86cbc8036ee3756ebe6f83b0cfaeb6405ec984d9eb4f9a50a6623fd1e93f605b121ae35d8c6030297ef3b32
|
7
|
+
data.tar.gz: e3ddd39b95e70dd79072d10363969dac3c9240b23d524a05b4160a781e976fe8cb71f6cdcc92236d4c245b344ea69016adea9ffc250704d4c419e8c081697af0
|
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
|
1
|
+
PseudoObject
|
2
|
+
====
|
2
3
|
|
3
|
-
|
4
|
+
[](https://badge.fury.io/rb/pseudo_object)
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
## Installation
|
6
|
+
Installation
|
7
|
+
----
|
8
8
|
|
9
9
|
Add this line to your application's Gemfile:
|
10
10
|
|
@@ -20,22 +20,18 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
$ gem install pseudo_object
|
22
22
|
|
23
|
-
|
23
|
+
Usage
|
24
|
+
----
|
24
25
|
|
25
26
|
TODO: Write usage instructions here
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
-
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
28
|
+
Contributing
|
29
|
+
----
|
32
30
|
|
33
|
-
|
31
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/indeep-xyz/pseudo-object.
|
34
32
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/pseudo_object.
|
36
33
|
|
37
|
-
|
38
|
-
|
34
|
+
License
|
35
|
+
----
|
39
36
|
|
40
37
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
-
|
@@ -5,9 +5,11 @@ module PseudoObject
|
|
5
5
|
|
6
6
|
PSEUDO_CLASS = ::BasicObject
|
7
7
|
PSEUDO_INSTANCE_METHODS = %i/
|
8
|
+
pseudo?
|
9
|
+
pseudo_infection=
|
10
|
+
pseudo_infection?
|
8
11
|
pseudo_object
|
9
12
|
pseudo_object=
|
10
|
-
pseudo?
|
11
13
|
/
|
12
14
|
|
13
15
|
# - - - - - - - - - - - - - - -
|
@@ -25,20 +27,32 @@ module PseudoObject
|
|
25
27
|
# - - - - - - - - - - - - - - -
|
26
28
|
# initialize
|
27
29
|
|
28
|
-
def initialize(
|
29
|
-
|
30
|
+
def initialize(
|
31
|
+
object,
|
32
|
+
infection: true
|
33
|
+
)
|
34
|
+
self.pseudo_object = object
|
35
|
+
self.pseudo_infection = infection
|
30
36
|
end
|
31
37
|
|
32
38
|
# - - - - - - - - - - - - - - -
|
33
39
|
# setter, bool
|
34
40
|
|
41
|
+
def pseudo?
|
42
|
+
true
|
43
|
+
end
|
44
|
+
|
35
45
|
def pseudo_object=(other)
|
36
46
|
validate_class(other)
|
37
47
|
@pseudo_object = other
|
38
48
|
end
|
39
49
|
|
40
|
-
def
|
41
|
-
|
50
|
+
def pseudo_infection?
|
51
|
+
@pseudo_infection
|
52
|
+
end
|
53
|
+
|
54
|
+
def pseudo_infection=(bool)
|
55
|
+
@pseudo_infection = !!bool
|
42
56
|
end
|
43
57
|
|
44
58
|
# - - - - - - - - - - - - - - -
|
@@ -49,9 +63,9 @@ module PseudoObject
|
|
49
63
|
end
|
50
64
|
private :method_missing
|
51
65
|
|
52
|
-
def validate_class(
|
53
|
-
unless
|
54
|
-
fail TypeError.new(
|
66
|
+
def validate_class(object)
|
67
|
+
unless object.kind_of?(PSEUDO_CLASS)
|
68
|
+
fail TypeError.new(object)
|
55
69
|
end
|
56
70
|
end
|
57
71
|
private :validate_class
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pseudo_object
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- indeep-xyz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -69,7 +69,7 @@ files:
|
|
69
69
|
- bin/console
|
70
70
|
- bin/setup
|
71
71
|
- lib/pseudo_object.rb
|
72
|
-
- lib/pseudo_object/basic_object.rb
|
72
|
+
- lib/pseudo_object/model/basic_object.rb
|
73
73
|
- lib/pseudo_object/version.rb
|
74
74
|
- pseudo_object.gemspec
|
75
75
|
homepage: https://github.com/indeep-xyz/pseudo-object
|