Class: RSS::Rss

Inherits:
Element show all
Includes:
RSS09, RootElementMixin
Defined in:
lib/rss/0.9.rb,
lib/rss/2.0.rb,
lib/rss/trackback.rb

Defined Under Namespace

Classes: Channel

Constant Summary

Constants included from RSS09

RSS::RSS09::ELEMENTS, RSS::RSS09::NSPOOL

Constants inherited from Element

Element::GET_ATTRIBUTES, Element::HAVE_CHILDREN_ELEMENTS, Element::INDENT, Element::MODELS, Element::MUST_CALL_VALIDATORS, Element::NEED_INITIALIZE_VARIABLES, Element::PLURAL_FORMS, Element::TO_ELEMENT_METHODS

Instance Attribute Summary collapse

Attributes included from RootElementMixin

#output_encoding

Attributes included from XMLStyleSheetMixin

#xml_stylesheets

Attributes inherited from Element

#do_validate

Instance Method Summary collapse

Methods included from RootElementMixin

#setup_maker, #to_xml

Methods included from RSS09

append_features

Methods inherited from Element

#convert, #converter=, #full_name, get_attributes, have_children_elements, inherited, install_ns, models, must_call_validators, need_initialize_variables, plural_forms, required_prefix, required_uri, #setup_maker, #tag_name, tag_name, to_element_methods, #to_s, #validate, #validate_for_stream

Methods included from BaseModel

#install_date_element, #install_have_child_element, #install_have_children_element, #install_text_element

Methods included from Utils

element_initialize_arguments?, get_file_and_line_from_caller, html_escape, new_with_value_if_need, to_class_name

Constructor Details

#initialize(rss_version, version = nil, encoding = nil, standalone = nil) ⇒ Rss

Returns a new instance of Rss.



27
28
29
# File 'lib/rss/0.9.rb', line 27

def initialize(rss_version, version=nil, encoding=nil, standalone=nil)
  super
end

Instance Attribute Details

#encodingObject

Returns the value of attribute encoding.



25
26
27
# File 'lib/rss/0.9.rb', line 25

def encoding
  @encoding
end

#rss_versionObject

Returns the value of attribute rss_version.



25
26
27
# File 'lib/rss/0.9.rb', line 25

def rss_version
  @rss_version
end

#standaloneObject

Returns the value of attribute standalone.



25
26
27
# File 'lib/rss/0.9.rb', line 25

def standalone
  @standalone
end

#versionObject

Returns the value of attribute version.



25
26
27
# File 'lib/rss/0.9.rb', line 25

def version
  @version
end

Instance Method Details

#imageObject



39
40
41
42
43
44
45
# File 'lib/rss/0.9.rb', line 39

def image
  if @channel
    @channel.image
  else
    nil
  end
end

#itemsObject



31
32
33
34
35
36
37
# File 'lib/rss/0.9.rb', line 31

def items
  if @channel
    @channel.items
  else
    []
  end
end

#setup_maker_elements(maker) ⇒ Object



55
56
57
58
59
60
# File 'lib/rss/0.9.rb', line 55

def setup_maker_elements(maker)
  super
  items.each do |item|
    item.setup_maker(maker.items)
  end
end

#textinputObject



47
48
49
50
51
52
53
# File 'lib/rss/0.9.rb', line 47

def textinput
  if @channel
    @channel.textInput
  else
    nil
  end
end