class GitWebHookModel::Parse

Public Class Methods

new(response) click to toggle source
# File lib/git_web_hook_model/parse.rb, line 5
def initialize(response)
  @response = response
end

Public Instance Methods

as_hash() click to toggle source
# File lib/git_web_hook_model/parse.rb, line 9
def as_hash
  hash? ? @response : parsed_response
end

Private Instance Methods

hash?() click to toggle source
# File lib/git_web_hook_model/parse.rb, line 15
def hash?
  @response.is_a?(Hash)
end
parsed_response() click to toggle source
# File lib/git_web_hook_model/parse.rb, line 19
def parsed_response
  JSON.parse(@response)
end