Class: Brrr::Channel

Inherits:
Object
  • 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

Parameters:

  • value

    the value to set the attribute document to.



3
4
5
# File 'lib/brrr/channel.rb', line 3

def document=(value)
  @document = value
end

Instance Method Details

#categoriesObject



49
50
51
# File 'lib/brrr/channel.rb', line 49

def categories
  @categories ||= channel_categories
end

#cloudObject



61
62
63
# File 'lib/brrr/channel.rb', line 61

def cloud
  @cloud ||= Cloud.new(document.at_xpath("//cloud"))
end


29
30
31
# File 'lib/brrr/channel.rb', line 29

def copyright
  @copyright ||= document.at_xpath("//copyright")&.content
end

#descriptionObject



21
22
23
# File 'lib/brrr/channel.rb', line 21

def description
  @description ||= document.at_xpath("//description").content
end

#docsObject



57
58
59
# File 'lib/brrr/channel.rb', line 57

def docs
  @docs ||= document.at_xpath("//docs")&.content
end

#generatorObject



53
54
55
# File 'lib/brrr/channel.rb', line 53

def generator
  @generator ||= document.at_xpath("//generator")&.content
end

#imageObject



69
70
71
# File 'lib/brrr/channel.rb', line 69

def image
  @image ||= Image.new(document.at_xpath("//image"))
end

#itemsObject



9
10
11
# File 'lib/brrr/channel.rb', line 9

def items
  @items ||= channel_items
end

#languageObject



25
26
27
# File 'lib/brrr/channel.rb', line 25

def language
  @language ||= document.at_xpath("//language")&.content
end

#last_build_dateObject



45
46
47
# File 'lib/brrr/channel.rb', line 45

def last_build_date
  @last_build_date ||= document.at_xpath("//lastBuildDate")&.content
end


17
18
19
# File 'lib/brrr/channel.rb', line 17

def link
  @link ||= document.at_xpath("//link").content
end

#managing_editorObject



33
34
35
# File 'lib/brrr/channel.rb', line 33

def managing_editor
  @managing_editor ||= document.at_xpath("//managingEditor")&.content
end

#pub_dateObject



41
42
43
# File 'lib/brrr/channel.rb', line 41

def pub_date
  @pub_date ||= document.at_xpath("//pubDate")&.content
end

#ratingObject



73
74
75
# File 'lib/brrr/channel.rb', line 73

def rating
  @rating ||= document.at_xpath("//rating")&.content
end

#skip_daysObject



85
86
87
# File 'lib/brrr/channel.rb', line 85

def skip_days
  @skip_days ||= channel_skip_days
end

#skip_hoursObject



81
82
83
# File 'lib/brrr/channel.rb', line 81

def skip_hours
  @skip_hours ||= channel_skip_hours
end

#text_inputObject



77
78
79
# File 'lib/brrr/channel.rb', line 77

def text_input
  @text_input ||= TextInput.new(document.at_xpath("//textInput"))
end

#titleObject



13
14
15
# File 'lib/brrr/channel.rb', line 13

def title
  @title ||= document.at_xpath("//title").content
end

#ttlObject



65
66
67
# File 'lib/brrr/channel.rb', line 65

def ttl
  @ttl ||= Integer(document.at_xpath("//ttl")&.content)
end

#web_masterObject



37
38
39
# File 'lib/brrr/channel.rb', line 37

def web_master
  @web_master ||= document.at_xpath("//webMaster")&.content
end