colonel_kurtz_ruby 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b528efe7c5c1f081f3d619ff7659dc646c59a1e7
4
- data.tar.gz: 167ee2566ed7de8ffb756a08eefb74c4f5fdbd55
3
+ metadata.gz: 84cdddaa9cd13f6d929f2f0be71dd7f9254fdbb0
4
+ data.tar.gz: 9187ae859dc491680917694605d807590d864947
5
5
  SHA512:
6
- metadata.gz: 4135c7634309dcee6d48edb46e38bd1e9d93ab512b6894c92833d35220f506adb5415ff01e96a88ed55746adbb650342a47af868d79412fb11cff6c69c756b63
7
- data.tar.gz: 642f1cdc925227eb85ed37630fb0b3e1af901fb25ef1966c93cebc2e6e05d88fabd3afb604e872effd692167f7b4cf0aee4c6fcce5e36d929dc365ce9d21e254
6
+ metadata.gz: 2c4994bd51c02a610b6c43ea5e05bf950534d59ba2bf9c1f1e64445b10648cbfba407bcd7cf47b596536f20512083c8a42ee6d6fc2a35c710cae44e5607402ed
7
+ data.tar.gz: 89e62c64492f0132699ccbc8248fe86f506f7660ef31b118e86b1e2fa7939dad7eb4eb94da82b30639b67d1732904a5b5588c355f684ce480c637dec84bd7b4f
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ *.gem
@@ -18,6 +18,8 @@
18
18
  module ColonelKurtz
19
19
  class Block
20
20
 
21
+ attr_reader :parent
22
+
21
23
  def initialize(data)
22
24
  @data = Data.new(data).to_hash
23
25
  end
@@ -30,8 +32,12 @@ module ColonelKurtz
30
32
  @content ||= data.fetch("content", {})
31
33
  end
32
34
 
35
+ def parent
36
+ @parent ||= data.fetch("parent", nil)
37
+ end
38
+
33
39
  def children
34
- @children ||= blocks.map{ |data| Block.new(data) }
40
+ @children ||= blocks.map{ |data| Block.new(data.merge("parent" => self)) }
35
41
  end
36
42
 
37
43
 
@@ -2,7 +2,7 @@ module ColonelKurtz
2
2
 
3
3
  VERSION = [
4
4
  0, # major
5
- 0, # minor
6
- 2 # patch
5
+ 1, # minor
6
+ 0 # patch
7
7
  ].join('.')
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: colonel_kurtz_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Viget
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-06-16 00:00:00.000000000 Z
11
+ date: 2015-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler