Class: Yarss::Item
- Inherits:
-
Object
- Object
- Yarss::Item
- Defined in:
- lib/yarss/item.rb
Overview
Feed item data holder.
Instance Attribute Summary collapse
-
#content ⇒ String
Content.
-
#id ⇒ String
ID.
-
#link ⇒ String
URL to the related Web page.
-
#title ⇒ String
Title.
-
#updated_at ⇒ DateTime
Date and time of the last modification.
Instance Method Summary collapse
-
#==(other) ⇒ Bool
Treat this class as a value object.
-
#initialize(attributes = nil) ⇒ Item
constructor
A new instance of Item.
Constructor Details
#initialize(attributes = nil) ⇒ Item
Returns a new instance of Item.
32 33 34 35 36 37 |
# File 'lib/yarss/item.rb', line 32 def initialize(attributes = nil) attributes.each do |attribute, value| setter = "#{attribute}=" send(setter, value) end if attributes end |
Instance Attribute Details
#content ⇒ String
Content.
29 30 31 |
# File 'lib/yarss/item.rb', line 29 def content @content end |
#id ⇒ String
ID.
9 10 11 |
# File 'lib/yarss/item.rb', line 9 def id @id end |
#link ⇒ String
URL to the related Web page.
24 25 26 |
# File 'lib/yarss/item.rb', line 24 def link @link end |
#title ⇒ String
Title.
14 15 16 |
# File 'lib/yarss/item.rb', line 14 def title @title end |
#updated_at ⇒ DateTime
Date and time of the last modification.
19 20 21 |
# File 'lib/yarss/item.rb', line 19 def updated_at @updated_at end |
Instance Method Details
#==(other) ⇒ Bool
Treat this class as a value object.
44 45 46 47 48 49 50 51 52 |
# File 'lib/yarss/item.rb', line 44 def ==(other) # rubocop:disable Metrics/AbcSize return false unless other.is_a?(self.class) id == other.id && title == other.title && updated_at == other.updated_at && link == other.link && content == other.content end |