Module: HoursToSeconds::EmbeddableInterface

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.routes?Boolean

#

HoursToSeconds::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)


18
19
20
21
22
23
# File 'lib/hours_to_seconds/www/embeddable_interface.rb', line 18

def self.routes?
  [
    'hours_to_seconds',
    'hours_to_seconds/*'
  ]
end

Instance Method Details

#return_sinatra_hours_to_secondsObject

#

return_sinatra_hours_to_seconds

#


28
29
30
31
# File 'lib/hours_to_seconds/www/embeddable_interface.rb', line 28

def return_sinatra_hours_to_seconds
  'Please provide the number of hours that should be converted into '\
  'n seconds.'
end

#return_sinatra_hours_to_seconds_with_arguments(i = web_params_as_string? ) ⇒ Object

#

return_sinatra_hours_to_seconds_with_arguments

#


36
37
38
39
40
41
42
43
44
# File 'lib/hours_to_seconds/www/embeddable_interface.rb', line 36

def return_sinatra_hours_to_seconds_with_arguments(
    i = web_params_as_string?
  )
  i = i.dup if i.frozen?
  n_seconds = HoursToSeconds[i.to_i, :be_quiet] # => 7200
  _ = ''.dup
  _ << '<b>'+i.to_s+'</b> hours equal <b>'+n_seconds.to_s+'</b> seconds.<br>'
  return _
end