Class: MeaningCloud::Topics
- Inherits:
-
Object
- Object
- MeaningCloud::Topics
- Defined in:
- lib/meaning_cloud/topics.rb
Overview
A class to hold all topic extraction related code.
:reek:MissingSafeMethod { exclude: [ required_key! ] }
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(options = {}) ⇒ Topics
constructor
A new instance of Topics.
Constructor Details
#initialize(options = {}) ⇒ Topics
Returns a new instance of Topics.
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/meaning_cloud/topics.rb', line 17 def initialize( = {}) @options = { of: :json, key: configuration.key, lang: configuration.language, tt: configuration.topic_types, ud: configuration.user_dictionary, uw: 'y' }.merge() end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
11 12 13 |
# File 'lib/meaning_cloud/topics.rb', line 11 def @options end |
Class Method Details
.extract_topics(options = {}) ⇒ Object
13 14 15 |
# File 'lib/meaning_cloud/topics.rb', line 13 def self.extract_topics( = {}) new().call end |
Instance Method Details
#call ⇒ Object
28 29 30 31 32 |
# File 'lib/meaning_cloud/topics.rb', line 28 def call required_key!() result = RestClient.post(configuration.api_base, ) JSON.parse(result) end |