whereistand 0.0.3 → 0.0.4

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/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.0.4. revised opinion to support position, taken, narrative
2
+
1
3
  v0.0.3. implemented account, issue, and opinion services, all unit tests succeeding
2
4
 
3
5
  v0.0.2. revising accessibility and naming conventions
data/Manifest CHANGED
@@ -27,3 +27,4 @@ lib/whereistand.rb
27
27
  spec/client_accounts_spec.rb
28
28
  spec/client_issues_spec.rb
29
29
  spec/client_opinions_spec.rb
30
+ whereistand.gemspec
@@ -18,16 +18,30 @@ class WIS::DOM::AccountIssues < WIS::DOM::Results
18
18
  unless i["Approved"].nil?
19
19
  opinion = WIS::DOM::AccountIssues.convert_hash_to_opinion(i["Approved"])
20
20
  issue_result.approved = WIS::DOM::ApprovedOpinion.new(opinion.account, opinion.issue)
21
+ issue_result.approved.position = opinion.position
22
+ issue_result.approved.narrative = opinion.narrative
23
+ issue_result.approved.taken = opinion.taken
21
24
  end
22
25
 
23
26
  unless i["Unverified"].nil?
24
27
  opinion = WIS::DOM::AccountIssues.convert_hash_to_opinion(i["Unverified"])
25
28
  issue_result.unverified = WIS::DOM::UnverifiedOpinion.new(opinion.account, opinion.issue)
29
+ issue_result.unverified.position = opinion.position
30
+ issue_result.approved.narrative = opinion.narrative
31
+ end
32
+
33
+ unless i["Expressed"].nil?
34
+ opinion = WIS::DOM::AccountIssues.convert_hash_to_opinion(i["Expressed"])
35
+ issue_result.expressed = WIS::DOM::ExpressedOpinion.new(opinion.account, opinion.issue)
36
+ issue_result.expressed.position = opinion.position
37
+ issue_result.expressed.narrative = opinion.narrative
38
+ issue_result.expressed.taken = opinion.taken
26
39
  end
27
40
 
28
41
  unless i["Unknown"].nil?
29
42
  opinion = WIS::DOM::AccountIssues.convert_hash_to_opinion(i["Unknown"])
30
43
  issue_result.unknown = WIS::DOM::UnknownOpinion.new(opinion.issue)
44
+ issue_result.unknown.position = opinion.position
31
45
  end
32
46
 
33
47
  issues << issue_result
@@ -39,6 +53,10 @@ class WIS::DOM::AccountIssues < WIS::DOM::Results
39
53
  def self.convert_hash_to_opinion(hash)
40
54
  account = WIS::DOM::Account.new(hash["Account"]["ID"], hash["Account"]["Name"], hash["Account"]["Description"]) unless hash["Account"].nil?
41
55
  issue = WIS::DOM::Issue.new(hash["Issue"]["ID"], hash["Issue"]["Description"])
42
- WIS::DOM::Opinion.new(account, issue)
56
+ opinion = WIS::DOM::Opinion.new(account, issue)
57
+ opinion.narrative = hash["Narrative"] unless hash["Narrative"].nil?
58
+ opinion.taken = hash["Taken"] unless hash["Taken"].nil?
59
+ opinion.position = hash["Position"] unless hash["Position"].nil?
60
+ opinion
43
61
  end
44
62
  end
@@ -1,2 +1,2 @@
1
- class WIS::DOM::ExpressedOpinion < WIS::DOM::Opinion
1
+ class WIS::DOM::ExpressedOpinion < WIS::DOM::Opinion
2
2
  end
@@ -1,4 +1,4 @@
1
1
  class WIS::DOM::IssueResult
2
- attr_accessor :issue, :unknown, :unverified, :approved
2
+ attr_accessor :issue, :unknown, :unverified, :approved, :expressed
3
3
 
4
4
  end
@@ -1,5 +1,6 @@
1
1
  class WIS::DOM::Opinion
2
2
  attr_reader :account, :issue
3
+ attr_accessor :taken, :position, :narrative
3
4
 
4
5
  def initialize(account, issue)
5
6
  @account = account
@@ -9,6 +10,10 @@ class WIS::DOM::Opinion
9
10
  def self.adapt_json(data)
10
11
  account = WIS::DOM::Account.new(data["Account"]["ID"], data["Account"]["Name"], data["Account"]["Description"])
11
12
  issue = WIS::DOM::Issue.new(data["Issue"]["ID"], data["Issue"]["Description"])
12
- WIS::DOM::Opinion.new(account, issue)
13
+ opinion = WIS::DOM::Opinion.new(account, issue)
14
+ opinion.narrative = data["Narrative"] unless data["Narrative"].nil?
15
+ opinion.taken = data["Taken"] unless data["Taken"].nil?
16
+ opinion.position = data["Position"] unless data["Position"].nil?
17
+ opinion
13
18
  end
14
19
  end
@@ -13,6 +13,10 @@ describe WIS::Client::Opinions do
13
13
  results = WIS::Client::Opinions.search_known_account_by_issue(account, "global warming")
14
14
  results.kind_of?(WIS::DOM::AccountIssues).should be_true
15
15
  results.hits.should > 0
16
+
17
+ results.issues.each do |issue_result|
18
+ issue_result.kind_of?(WIS::DOM::IssueResult).should be_true
19
+ end
16
20
  end
17
21
 
18
22
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{whereistand}
5
- s.version = "0.0.3"
5
+ s.version = "0.0.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["whereIstand"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whereistand
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - whereIstand