Class: Webshaker::Shaker

Inherits:
Object
  • Object
show all
Defined in:
lib/webshaker/shaker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, scrape_options = {}, status_update: ->(status) {})
  @url = url
  @scrape_options = scrape_options
  @status_update = status_update
end

Instance Attribute Details

#scrape_optionsObject (readonly)

Returns the value of attribute scrape_options.



5
6
7
# File 'lib/webshaker/shaker.rb', line 5

def scrape_options
  @scrape_options
end

#status_updateObject (readonly)

Returns the value of attribute status_update.



5
6
7
# File 'lib/webshaker/shaker.rb', line 5

def status_update
  @status_update
end

#urlObject (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