Class: TheCity::Terminology
- Defined in:
- lib/api/terminology.rb
Instance Attribute Summary
Attributes inherited from ApiObject
#error_messages, #marked_for_destruction
Class Method Summary collapse
-
.load_by_term(term) ⇒ Object
Loads the terminology by the specified term.
Instance Method Summary collapse
-
#initialize(json_data) ⇒ Terminology
constructor
Constructor.
Methods inherited from ApiObject
__tc_attributes, #delete, #initialize_from_json_object, #is_deleted?, #save, #set_attributes, tc_attr_accessor, #to_attributes
Constructor Details
#initialize(json_data) ⇒ Terminology
Constructor.
24 25 26 27 28 |
# File 'lib/api/terminology.rb', line 24 def initialize(json_data) @writer_object = TerminologyWriter self.term = json_data.keys[0] self.label = json_data.values[0] end |
Class Method Details
.load_by_term(term) ⇒ Object
Loads the terminology by the specified term.
Returns a new TheCity::Terminology object.
14 15 16 17 18 19 |
# File 'lib/api/terminology.rb', line 14 def self.load_by_term(term) reader = TerminologyReader.new(term) self.new(reader.load_feed) rescue nil end |