Module: Crunchbase::Utilities::CbModel
- Included in:
- Autocompletes::Client, DeletedEntities::Client, Entities::Client, Searches::Client
- Defined in:
- lib/crunchbase/utilities/cb_model.rb
Overview
API Request
Instance Attribute Summary collapse
-
#entity_type ⇒ Object
Returns the value of attribute entity_type.
Class Method Summary collapse
Instance Attribute Details
#entity_type ⇒ Object
Returns the value of attribute entity_type.
8 9 10 |
# File 'lib/crunchbase/utilities/cb_model.rb', line 8 def entity_type @entity_type end |
Class Method Details
.cbobject ⇒ Object
12 13 14 |
# File 'lib/crunchbase/utilities/cb_model.rb', line 12 def cbobject kclass_name.new end |
.exact_kclass_object ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/crunchbase/utilities/cb_model.rb', line 20 def exact_kclass_object return entity_type if entity_type.is_a?(Class) cb_type = [ 'Crunchbase', 'Models', entity_type.split('_').map(&:capitalize).join ].join('::') Kernel.const_get("::#{cb_type}") end |
.kclass_name ⇒ Object
16 17 18 |
# File 'lib/crunchbase/utilities/cb_model.rb', line 16 def kclass_name @kclass_name ||= exact_kclass_object end |