Class: DoingStream::Stream::Entry
- Inherits:
-
Struct
- Object
- Struct
- DoingStream::Stream::Entry
- Defined in:
- lib/doing_stream/stream/entry.rb
Direct Known Subclasses
DoingStream::Streams::GitHub::Entry, DoingStream::Streams::LastFM::Entry, DoingStream::Streams::StackOverflow::Entry, DoingStream::Streams::Twitter::Entry, DoingStream::Streams::Vimeo::Likes::Entry, DoingStream::Streams::Vimeo::Videos::Entry
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data
5 6 7 |
# File 'lib/doing_stream/stream/entry.rb', line 5 def data @data end |
#name ⇒ Object
Returns the value of attribute name
5 6 7 |
# File 'lib/doing_stream/stream/entry.rb', line 5 def name @name end |
Instance Method Details
#published ⇒ Object
6 7 8 9 10 |
# File 'lib/doing_stream/stream/entry.rb', line 6 def published published = data['published'] published = Time.new published unless published.is_a? Time published end |
#to_h ⇒ Object
12 13 14 |
# File 'lib/doing_stream/stream/entry.rb', line 12 def to_h { 'feed_name' => name, name => 'true', 'published' => published, 'data' => data } end |
#to_json ⇒ Object
16 17 18 |
# File 'lib/doing_stream/stream/entry.rb', line 16 def to_json to_h.to_json end |