Class: GH::Normalizer

Inherits:
Wrapper show all
Defined in:
lib/gh/normalizer.rb

Overview

Public: A Wrapper class that deals with normalizing Github responses.

Instance Attribute Summary

Attributes inherited from Wrapper

#backend

Instance Method Summary collapse

Methods inherited from Wrapper

[], #frontend, #frontend=, #initialize, #inspect, #load, #prefixed, #reset, wraps

Constructor Details

This class inherits a constructor from GH::Wrapper

Instance Method Details

#[](key) ⇒ Object

Public: Fetches and normalizes a github entity.

Returns normalized Response.



10
11
12
13
14
# File 'lib/gh/normalizer.rb', line 10

def [](key)
  result = super
  links(result)['self'] ||= { 'href' => full_url(key).to_s } if result.respond_to? :to_hash
  result
end