Module: HardwareInformation::EmbeddableInterface

Defined in:
lib/hardware_information/www/embeddable_interface.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.routes?Boolean

#

HardwareInformation::EmbeddableInterface.routes?

Define all legal routes via this Array. This Array will then be used to add more routes to any sinatra-application that needs it.

#

Returns:

  • (Boolean)


20
21
22
23
24
# File 'lib/hardware_information/www/embeddable_interface.rb', line 20

def self.routes?
  [
    'hardware_information'
  ]
end

Instance Method Details

#return_sinatra_hardware_informationObject

#

return_sinatra_hardware_information

#


29
30
31
32
33
34
35
36
37
38
39
# File 'lib/hardware_information/www/embeddable_interface.rb', line 29

def return_sinatra_hardware_information
  hash = HardwareInformation::PurchasedHardware.my_hardware
  _ = ''.dup
  hash.each_pair {|key, inner_hash|
    _ << "#{key}<br>"
    _ << '<span style="margin-left: 1em">bought at: '+
         inner_hash['bought_at'].to_s+'</span><br>'
    _ << '<br>'
  }
  return _
end