objbot 0.0.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 +7 -0
- data/lib/objbot.rb +27 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b5b3bc0b7ae46cfb9fae74648c1d35dcb83cf928
|
4
|
+
data.tar.gz: 79a335f9275ba2bad7c250ba75a4a61d85724695
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d1ee9f687837df85fb7f7458d25a554b7d1f7da0cc424f8b148eb15476d06e282afd308046ba12dfdfbbed9bc7dbeb124473a27895249be4607e86ba9073d376
|
7
|
+
data.tar.gz: 971f76d3d7f43fbfa6011613581fcc28b6380fb186ab8afcc42eadec3ee79b157fcd479f3997cf4fedbf0c6d9afb27e8125d54431afd0513d2a0b816bdc89ca7
|
data/lib/objbot.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
class Objbot
|
2
|
+
def self.method_missing(method, *args, &block)
|
3
|
+
case method
|
4
|
+
when :obj
|
5
|
+
obj = Obj.new args[0]
|
6
|
+
@@context.push [method, obj]
|
7
|
+
self.instance_eval(&block) if block_given?
|
8
|
+
@@context.pop
|
9
|
+
when :str
|
10
|
+
last_obj.add_field method, *args
|
11
|
+
when :many, :one
|
12
|
+
last_obj.add_relationship args[0], args[1], method
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.define(&block)
|
17
|
+
@@objs = {}
|
18
|
+
@@context = []
|
19
|
+
instance_eval(&block)
|
20
|
+
end
|
21
|
+
|
22
|
+
class << self
|
23
|
+
def last_obj
|
24
|
+
@@context.last[1]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: objbot
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Leo Stanley
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-06-13 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Placeholder
|
14
|
+
email:
|
15
|
+
- leo@byteio.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- lib/objbot.rb
|
21
|
+
homepage:
|
22
|
+
licenses: []
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubyforge_project:
|
40
|
+
rubygems_version: 2.0.3
|
41
|
+
signing_key:
|
42
|
+
specification_version: 4
|
43
|
+
summary: Placeholder
|
44
|
+
test_files: []
|