Class: NexosisApi::VocabularySummary
- Inherits:
-
Object
- Object
- NexosisApi::VocabularySummary
- Defined in:
- lib/nexosis_api/vocabulary_summary.rb
Overview
parsed results of a request for vocabulary
Instance Attribute Summary collapse
-
#column_name ⇒ String
readonly
text-based column name from the datasource.
-
#created_by_session ⇒ String
readonly
The unique id of the session for which this vocabulary was built.
-
#created_on ⇒ DateTime
readonly
The date on which the vocabulary was created.
-
#datasource_name ⇒ String
readonly
datasource which contained the text column the vocabulary was built from.
-
#datasource_type ⇒ String
readonly
determines if data source was dataSet, View, or other.
-
#links ⇒ Arrays
readonly
hypermedia related to this vocabulary.
-
#vocabulary_id ⇒ String
readonly
unique identifier for this vocabulary.
Instance Method Summary collapse
-
#initialize(vocab_hash) ⇒ VocabularySummary
constructor
A new instance of VocabularySummary.
Constructor Details
#initialize(vocab_hash) ⇒ VocabularySummary
Returns a new instance of VocabularySummary.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/nexosis_api/vocabulary_summary.rb', line 5 def initialize(vocab_hash) var_map = { 'id' => :@vocabulary_id, 'dataSourceName' => :@datasource_name, 'columnName' => :@column_name, 'dataSourceType' => :@datasource_type, 'createdOnDate' => :@created_on, 'createdBySessionId' => :@created_by_session } vocab_hash.each { |k, v| instance_variable_set(var_map[k.to_s], v) unless var_map[k.to_s].nil? } @links = vocab_hash['links'].reject(&:nil?).map { |l| NexosisApi::Link.new(l) } end |
Instance Attribute Details
#column_name ⇒ String (readonly)
text-based column name from the datasource
26 27 28 |
# File 'lib/nexosis_api/vocabulary_summary.rb', line 26 def column_name @column_name end |
#created_by_session ⇒ String (readonly)
The unique id of the session for which this vocabulary was built.
38 39 40 |
# File 'lib/nexosis_api/vocabulary_summary.rb', line 38 def created_by_session @created_by_session end |
#created_on ⇒ DateTime (readonly)
The date on which the vocabulary was created
34 35 36 |
# File 'lib/nexosis_api/vocabulary_summary.rb', line 34 def created_on @created_on end |
#datasource_name ⇒ String (readonly)
datasource which contained the text column the vocabulary was built from
22 23 24 |
# File 'lib/nexosis_api/vocabulary_summary.rb', line 22 def datasource_name @datasource_name end |
#datasource_type ⇒ String (readonly)
determines if data source was dataSet, View, or other
30 31 32 |
# File 'lib/nexosis_api/vocabulary_summary.rb', line 30 def datasource_type @datasource_type end |
#links ⇒ Arrays (readonly)
hypermedia related to this vocabulary
42 43 44 |
# File 'lib/nexosis_api/vocabulary_summary.rb', line 42 def links @links end |
#vocabulary_id ⇒ String (readonly)
unique identifier for this vocabulary
18 19 20 |
# File 'lib/nexosis_api/vocabulary_summary.rb', line 18 def vocabulary_id @vocabulary_id end |