class Megam::GogsTokens

Public Class Methods

error(response) click to toggle source
# File lib/megam/core/gogs_tokens.rb, line 43
def self.error(response)

  {:status => response.status, :body => ""}
end
list(username, password) click to toggle source
# File lib/megam/core/gogs_tokens.rb, line 28
def self.list(username, password)

  megams = Megam::Gogs.new
  res = megams.get_tokens(username, password)
  hash = {}
  puts res
  puts res.status
  if res.status != 200
    hash = self.error(res)
  else
    hash = self.to_hash(res)
  end
  hash
end
to_hash(response) click to toggle source

Transform the ruby obj -> to a Hash

# File lib/megam/core/gogs_tokens.rb, line 20
def self.to_hash(response)
  
   index_hash = response.body
  {:status => response.status, :body => index_hash }
end

Public Instance Methods

to_s() click to toggle source
# File lib/megam/core/gogs_tokens.rb, line 48
def to_s
  Megam::Stuff.styled_hash(to_hash)
end