Class: WarrantyCheck::BaseVendor

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

Direct Known Subclasses

APPLE, DELL, FUJITSU, HP, IBM

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sn) ⇒ BaseVendor

Returns a new instance of BaseVendor.



17
18
19
20
# File 'lib/vendors/base_vendor.rb', line 17

def initialize(sn)
  @sn = sn
  @warranties = []
end

Instance Attribute Details

#domObject (readonly)

Returns the value of attribute dom.



14
15
16
# File 'lib/vendors/base_vendor.rb', line 14

def dom
  @dom
end

#htmlObject (readonly)

Returns the value of attribute html.



13
14
15
# File 'lib/vendors/base_vendor.rb', line 13

def html
  @html
end

#warrantiesObject (readonly)

Returns the value of attribute warranties.



15
16
17
# File 'lib/vendors/base_vendor.rb', line 15

def warranties
  @warranties
end

Instance Method Details

#checkObject



22
23
24
# File 'lib/vendors/base_vendor.rb', line 22

def check
  nil
end

#http_methodObject



34
35
36
# File 'lib/vendors/base_vendor.rb', line 34

def http_method
  :get
end

#service_base_urlObject



26
27
28
# File 'lib/vendors/base_vendor.rb', line 26

def service_base_url
  "http://www.example.com"
end

#service_uriObject



30
31
32
# File 'lib/vendors/base_vendor.rb', line 30

def service_uri
  "/%s"
end

#uriObject



42
43
44
# File 'lib/vendors/base_vendor.rb', line 42

def uri
  @uri ||= sprintf(service_uri, @sn)
end

#urlObject



38
39
40
# File 'lib/vendors/base_vendor.rb', line 38

def url
  @url ||= URI.parse(service_base_url)
end