sirportly 1.0.0 → 1.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.
data/lib/sirportly.rb CHANGED
@@ -12,7 +12,7 @@ module Sirportly
12
12
 
13
13
  ## Returns the current version number for the Sirportly API client.
14
14
  def version
15
- "1.0.0-beta"
15
+ "1.0.1-beta"
16
16
  end
17
17
 
18
18
  ## Stores authentication details
@@ -2,24 +2,23 @@ module Sirportly
2
2
  class KnowledgeBase
3
3
 
4
4
  attr_accessor :id
5
-
5
+
6
6
  class << self
7
-
8
7
  def list
9
8
  Request.request('knowledge/list')
10
9
  end
11
10
 
12
11
  def find_by_id(id)
13
- Request.request('knowledge/tree', :kb => id)
14
- self.new(id)
12
+ tree = Request.request('knowledge/tree', :kb => id)
13
+ self.new(id, tree = tree)
15
14
  rescue Errors::NotFound
16
15
  false
17
16
  end
18
-
19
17
  end
20
18
 
21
- def initialize(id)
22
- self.id = id
19
+ def initialize(id, tree = nil)
20
+ @id = id
21
+ @tree = tree
23
22
  end
24
23
 
25
24
  def page(path)
@@ -27,7 +26,7 @@ module Sirportly
27
26
  end
28
27
 
29
28
  def tree
30
- request('tree')
29
+ @tree ||= request('tree')
31
30
  end
32
31
 
33
32
  def add_page(options = {})
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sirportly
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-26 00:00:00.000000000Z
12
+ date: 2012-02-02 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email: adam@atechmedia.com