Class: App42::AppTab::TimeUnit

Inherits:
App42Response show all
Defined in:
lib/appTab/TimeUnit.rb

Overview

An enum that contains the Time Unit to be mentioned in the Bill.

Constant Summary collapse

SECONDS =
"SECONDS"
MINUTES =
"MINUTES"
HOURS =
"HOURS"

Instance Attribute Summary

Attributes inherited from App42Response

#isResponseSuccess, #strResponse, #totalRecords

Instance Method Summary collapse

Instance Method Details

#enum(string) ⇒ Object

Sets the value of the TimeUnit.

Parameters:

  • string
    • the string of TimeUnit



25
26
27
# File 'lib/appTab/TimeUnit.rb', line 25

def enum(string)
  return TimeUnit.const_get(string)
end

#isAvailable(string) ⇒ Object

Returns the value of the TimeUnit.

Returns:

  • the value of TimeUnit.



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/appTab/TimeUnit.rb', line 35

def isAvailable(string)
  if(string == "SECONDS")
    return "SECONDS"
  elsif(string == "MINUTES")
    return "MINUTES"
  elsif(string == "HOURS")
    return "HOURS";
  else
    return nil
  end
end