Class: HyperMiner

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

Instance Method Summary collapse

Constructor Details

#initialize(resource_url) ⇒ HyperMiner

Returns a new instance of HyperMiner.



8
9
10
# File 'lib/hyper_miner.rb', line 8

def initialize(resource_url)
  @resource_url = resource_url
end

Instance Method Details

#mine(&block) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/hyper_miner.rb', line 12

def mine(&block)
  raise "Mine instructions must be provided." unless block_given?

  html = get_resource_html

  mine_plan = MinePlan.new(html, &block)
  mined_data = mine_plan.execute

  mined_data
end