Class: AlchemyAPI::Client
- Inherits:
-
Object
- Object
- AlchemyAPI::Client
- Includes:
- HTTParty
- Defined in:
- lib/alchemy-api.rb
Constant Summary collapse
- COMMON_FUNCTIONS =
Functions that can use Text, HTML, or URL
[ "GetRankedNamedEntities", "GetTextSentiment", "GetTargetedSentiment", "GetRankedKeywords", "GetRankedConcepts", "GetRelations", "GetCategory", "GetLanguage" ]
- WEB_ONLY_FUNCTIONS =
[ "GetAuthor", "GetFeedLinks", "GetText", "GetRawText", "GetTitle", "GetMicroformatData", "GetConstraintQuery" ]
- TEXT_FUNCTIONS =
COMMON_FUNCTIONS.map { |func| "Text" + func }
- HTML_FUNCTIONS =
(COMMON_FUNCTIONS+WEB_ONLY_FUNCTIONS).map { |func| "HTML" + func }
- URL_FUNCTIONS =
(COMMON_FUNCTIONS+WEB_ONLY_FUNCTIONS).map { |func| "URL" + func }
Instance Method Summary collapse
-
#initialize(api_key) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(api_key) ⇒ Client
Returns a new instance of Client.
35 36 37 |
# File 'lib/alchemy-api.rb', line 35 def initialize(api_key) = { apikey: api_key, outputMode: 'json' } end |