Class: Twithub::Entries

Inherits:
Object
  • Object
show all
Defined in:
lib/twithub/entries.rb

Instance Method Summary collapse

Instance Method Details

#from_json(json) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/twithub/entries.rb', line 3

def from_json(json)
  parsed = JSON.parse(json)
  return entry_for(parsed) if parsed.is_a?(Hash)
  if parsed.is_a?(Array)
    return  parsed.map {|e| entry_for(e) } 
  end
end