Class: ShiftPlanning::Config
- Inherits:
-
Object
- Object
- ShiftPlanning::Config
- Defined in:
- lib/shiftplanning/config.rb
Constant Summary collapse
- @@uri =
Setup class variables
URI.parse("https://www.humanity.com/api/")
- @@http =
Net::HTTP.new(@@uri.host, @@uri.port)
- @@api_path =
@@uri.path
- @@return_types =
%w(json xml html)
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Define getters and setters.
-
#output ⇒ Object
Returns the value of attribute output.
-
#token ⇒ Object
Define getters and setters.
Instance Method Summary collapse
-
#initialize(_api_key, options = {}) ⇒ Config
constructor
Constructor **********************************.
Constructor Details
#initialize(_api_key, options = {}) ⇒ Config
Constructor **********************************
39 40 41 42 43 44 45 46 |
# File 'lib/shiftplanning/config.rb', line 39 def initialize _api_key, = {} self.api_key = _api_key self.output=([:output]||'json') self.token=([:token]) @session = [:session] self.token = @session[:sp_token] unless @session.nil? @@http.set_debug_output([:outfile]||$stdout) if [:verbose] end |
Instance Attribute Details
#api_key ⇒ Object
Define getters and setters
34 35 36 |
# File 'lib/shiftplanning/config.rb', line 34 def api_key @api_key end |
#output ⇒ Object
Returns the value of attribute output.
35 36 37 |
# File 'lib/shiftplanning/config.rb', line 35 def output @output end |
#token ⇒ Object
Define getters and setters
34 35 36 |
# File 'lib/shiftplanning/config.rb', line 34 def token @token end |