ruby-factual 0.0.4 → 0.0.5

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.
Files changed (2) hide show
  1. data/lib/factual.rb +11 -8
  2. metadata +3 -3
data/lib/factual.rb CHANGED
@@ -86,9 +86,11 @@ module Factual
86
86
 
87
87
  def initialize(table, row_data)
88
88
  @subject_key = row_data[0]
89
- @fields = table.fields
90
- @table_key = table.key
91
- @adapter = table.adapter
89
+
90
+ @table = table
91
+ @fields = @table.fields
92
+ @table_key = @table.key
93
+ @adapter = @table.adapter
92
94
 
93
95
  @subject = []
94
96
  @fields.each_with_index do |f, idx|
@@ -99,7 +101,7 @@ module Factual
99
101
  @facts_hash = {}
100
102
  @fields.each_with_index do |f, idx|
101
103
  next if f["isPrimary"]
102
- @facts_hash[f["field_ref"]] = Fact.new(@adapter, @table_key, @subject_key, f, row_data[idx+1])
104
+ @facts_hash[f["field_ref"]] = Fact.new(@table, @subject_key, f, row_data[idx+1])
103
105
  end
104
106
  end
105
107
 
@@ -116,12 +118,13 @@ module Factual
116
118
  class Fact
117
119
  attr_accessor :value, :subject_key, :field, :adapter
118
120
 
119
- def initialize(adapter, table_key, subject_key, field, value)
121
+ def initialize(table, subject_key, field, value)
120
122
  @value = value
121
- @subject_key = subject_key
122
- @table_key = table_key
123
123
  @field = field
124
- @adapter = adapter
124
+ @subject_key = subject_key
125
+
126
+ @table_key = table.key
127
+ @adapter = table.adapter
125
128
  end
126
129
 
127
130
  def field_ref
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-factual
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Forrest Cao