Class: Tobacco::Inhaler

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url = '') ⇒ Inhaler

Returns a new instance of Inhaler.



5
6
7
# File 'lib/tobacco/inhaler.rb', line 5

def initialize(url = '')
  self.url = url
end

Instance Attribute Details

#urlObject

Returns the value of attribute url.



3
4
5
# File 'lib/tobacco/inhaler.rb', line 3

def url
  @url
end

Instance Method Details

#readObject



9
10
11
# File 'lib/tobacco/inhaler.rb', line 9

def read
  @content ||= Tobacco::Burnout.try(3) { URI.parse(url).read }
end