Class: Columbus::Feed

Inherits:
Struct
  • Object
show all
Defined in:
lib/columbus/feed.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Feed

Returns a new instance of Feed.



5
6
7
8
# File 'lib/columbus/feed.rb', line 5

def initialize(*args)
  super(*args)
  determine_feed_endpoint
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



3
4
5
# File 'lib/columbus/feed.rb', line 3

def body
  @body
end

#titleObject

Returns the value of attribute title

Returns:

  • (Object)

    the current value of title



2
3
4
# File 'lib/columbus/feed.rb', line 2

def title
  @title
end

#urlObject

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



2
3
4
# File 'lib/columbus/feed.rb', line 2

def url
  @url
end

Instance Method Details

#determine_feed_endpointObject



10
11
12
13
14
15
# File 'lib/columbus/feed.rb', line 10

def determine_feed_endpoint
  response = RedirectFollower.new(url).resolve
  self.url = response.url
  self.body = response.body
  self
end