Class: Twithub::FeedEntry

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/twithub/feed_entry.rb

Direct Known Subclasses

GithubEntry, TwitterEntry

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



5
6
7
# File 'lib/twithub/feed_entry.rb', line 5

def content
  @content
end

#originObject (readonly)

Returns the value of attribute origin.



5
6
7
# File 'lib/twithub/feed_entry.rb', line 5

def origin
  @origin
end

#posted_atObject (readonly)

Returns the value of attribute posted_at.



5
6
7
# File 'lib/twithub/feed_entry.rb', line 5

def posted_at
  @posted_at
end

#usernameObject (readonly)

Returns the value of attribute username.



5
6
7
# File 'lib/twithub/feed_entry.rb', line 5

def username
  @username
end

Instance Method Details

#<=>(other_entry) ⇒ Object



7
8
9
# File 'lib/twithub/feed_entry.rb', line 7

def <=>(other_entry)
  other_entry.posted_at <=> posted_at
end

#to_json(*args) ⇒ Object



11
12
13
14
# File 'lib/twithub/feed_entry.rb', line 11

def to_json(*args)
  { :content => content, :username => username, 
    :posted_at => posted_at, :origin => origin }.to_json      
end