Class: Brrr::Channel
- Inherits:
-
Object
show all
- Defined in:
- lib/brrr/channel.rb,
lib/brrr/channel/cloud.rb,
lib/brrr/channel/image.rb,
lib/brrr/channel/category.rb,
lib/brrr/channel/text_input.rb
Defined Under Namespace
Classes: Category, Cloud, Image, TextInput
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(xml) ⇒ Channel
Returns a new instance of Channel.
5
6
7
|
# File 'lib/brrr/channel.rb', line 5
def initialize(xml)
self.document = Nokogiri.XML(xml)
end
|
Instance Attribute Details
#document=(value) ⇒ Object
Sets the attribute document
3
4
5
|
# File 'lib/brrr/channel.rb', line 3
def document=(value)
@document = value
end
|
Instance Method Details
#categories ⇒ Object
49
50
51
|
# File 'lib/brrr/channel.rb', line 49
def categories
@categories ||= channel_categories
end
|
#cloud ⇒ Object
61
62
63
|
# File 'lib/brrr/channel.rb', line 61
def cloud
@cloud ||= Cloud.new(document.at_xpath("//cloud"))
end
|
#copyright ⇒ Object
29
30
31
|
# File 'lib/brrr/channel.rb', line 29
def copyright
@copyright ||= document.at_xpath("//copyright")&.content
end
|
#description ⇒ Object
21
22
23
|
# File 'lib/brrr/channel.rb', line 21
def description
@description ||= document.at_xpath("//description").content
end
|
#docs ⇒ Object
57
58
59
|
# File 'lib/brrr/channel.rb', line 57
def docs
@docs ||= document.at_xpath("//docs")&.content
end
|
#generator ⇒ Object
53
54
55
|
# File 'lib/brrr/channel.rb', line 53
def generator
@generator ||= document.at_xpath("//generator")&.content
end
|
#image ⇒ Object
69
70
71
|
# File 'lib/brrr/channel.rb', line 69
def image
@image ||= Image.new(document.at_xpath("//image"))
end
|
#items ⇒ Object
9
10
11
|
# File 'lib/brrr/channel.rb', line 9
def items
@items ||= channel_items
end
|
#language ⇒ Object
25
26
27
|
# File 'lib/brrr/channel.rb', line 25
def language
@language ||= document.at_xpath("//language")&.content
end
|
#last_build_date ⇒ Object
45
46
47
|
# File 'lib/brrr/channel.rb', line 45
def last_build_date
@last_build_date ||= document.at_xpath("//lastBuildDate")&.content
end
|
#link ⇒ Object
17
18
19
|
# File 'lib/brrr/channel.rb', line 17
def link
@link ||= document.at_xpath("//link").content
end
|
#managing_editor ⇒ Object
33
34
35
|
# File 'lib/brrr/channel.rb', line 33
def managing_editor
@managing_editor ||= document.at_xpath("//managingEditor")&.content
end
|
#pub_date ⇒ Object
41
42
43
|
# File 'lib/brrr/channel.rb', line 41
def pub_date
@pub_date ||= document.at_xpath("//pubDate")&.content
end
|
#rating ⇒ Object
73
74
75
|
# File 'lib/brrr/channel.rb', line 73
def rating
@rating ||= document.at_xpath("//rating")&.content
end
|
#skip_days ⇒ Object
85
86
87
|
# File 'lib/brrr/channel.rb', line 85
def skip_days
@skip_days ||= channel_skip_days
end
|
#skip_hours ⇒ Object
81
82
83
|
# File 'lib/brrr/channel.rb', line 81
def skip_hours
@skip_hours ||= channel_skip_hours
end
|
#text_input ⇒ Object
77
78
79
|
# File 'lib/brrr/channel.rb', line 77
def text_input
@text_input ||= TextInput.new(document.at_xpath("//textInput"))
end
|
#title ⇒ Object
13
14
15
|
# File 'lib/brrr/channel.rb', line 13
def title
@title ||= document.at_xpath("//title").content
end
|
#ttl ⇒ Object
65
66
67
|
# File 'lib/brrr/channel.rb', line 65
def ttl
@ttl ||= Integer(document.at_xpath("//ttl")&.content)
end
|
#web_master ⇒ Object
37
38
39
|
# File 'lib/brrr/channel.rb', line 37
def web_master
@web_master ||= document.at_xpath("//webMaster")&.content
end
|