Class: Gns::GithubItem

Inherits:
Object
  • Object
show all
Defined in:
lib/gns/github_atom.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(atom_item) ⇒ GithubItem

Returns a new instance of GithubItem.



35
36
37
38
39
40
41
42
43
# File 'lib/gns/github_atom.rb', line 35

def initialize(atom_item)
  @updated = atom_item.updated.content
  @title = atom_item.title.content
  @url = atom_item.link.href
  atom_item.content.content =~ /<p>(.*)<\/p>/
  @body = $1
  atom_item.content.content =~ /<a.*>(.*)<\/a>/
  @repo = $1
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



33
34
35
# File 'lib/gns/github_atom.rb', line 33

def body
  @body
end

#repoObject (readonly)

Returns the value of attribute repo.



33
34
35
# File 'lib/gns/github_atom.rb', line 33

def repo
  @repo
end

#titleObject (readonly)

Returns the value of attribute title.



33
34
35
# File 'lib/gns/github_atom.rb', line 33

def title
  @title
end

#updatedObject (readonly)

Returns the value of attribute updated.



33
34
35
# File 'lib/gns/github_atom.rb', line 33

def updated
  @updated
end

#urlObject (readonly)

Returns the value of attribute url.



33
34
35
# File 'lib/gns/github_atom.rb', line 33

def url
  @url
end