Class: Webshaker::Shaker
- Inherits:
-
Object
- Object
- Webshaker::Shaker
- Defined in:
- lib/webshaker/shaker.rb
Instance Attribute Summary collapse
-
#scrape_options ⇒ Object
readonly
Returns the value of attribute scrape_options.
-
#status_update ⇒ Object
readonly
Returns the value of attribute status_update.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url, scrape_options = {}, status_update: ->(status) {}) ⇒ Shaker
constructor
A new instance of Shaker.
- #shake(with_prompt:, respond_with: :text, temperature: 0.8) ⇒ Object
Constructor Details
#initialize(url, scrape_options = {}, status_update: ->(status) {}) ⇒ Shaker
Returns a new instance of Shaker.
7 8 9 10 11 |
# File 'lib/webshaker/shaker.rb', line 7 def initialize(url, = {}, status_update: ->(status) {}) @url = url @scrape_options = @status_update = status_update end |
Instance Attribute Details
#scrape_options ⇒ Object (readonly)
Returns the value of attribute scrape_options.
5 6 7 |
# File 'lib/webshaker/shaker.rb', line 5 def @scrape_options end |
#status_update ⇒ Object (readonly)
Returns the value of attribute status_update.
5 6 7 |
# File 'lib/webshaker/shaker.rb', line 5 def status_update @status_update end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
5 6 7 |
# File 'lib/webshaker/shaker.rb', line 5 def url @url end |
Instance Method Details
#shake(with_prompt:, respond_with: :text, temperature: 0.8) ⇒ Object
13 14 15 |
# File 'lib/webshaker/shaker.rb', line 13 def shake(with_prompt:, respond_with: :text, temperature: 0.8) ai.analyze(with_prompt:, respond_with: :text, temperature: 0.8) end |