Class: CocRb::GoldPass

Inherits:
Settings show all
Defined in:
lib/cocRb/gp.rb

Class Method Summary collapse

Methods inherited from Settings

get

Class Method Details

.get_GoldPassInfo(status: false) ⇒ Object

This method gets GoldPass Information.



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/cocRb/gp.rb', line 43

def self.get_GoldPassInfo(status: false)
     get
     res = @conn.get("v1/goldpass/seasons/current")

     if status
     res.status
     else
     val = res.body

     convert = JSON.parse(val)

     startTime = convert["startTime"]

     endTime = convert["endTime"]

     t = Time.parse(startTime).strftime('%y-%m-%d, %H:%M:%S %p')

     t1 = Time.parse(endTime).strftime('%y-%m-%d, %H:%M:%S %p')

      gp = {
      "startTime" => startTime,
      "endTime" => endTime
      },
      {
      "parsed_startTime" => t,
      "parsed_endTime" => t1
      }.freeze

    end
end