Module: RSS::BaseModel

Module | RSS::BaseModel
In: | rss/rss.rb

### Methods

install_date_element install_have_attribute_element install_have_child_element install_have_children_element install_text_element

### Included Modules

Utils

### Public Instance methods

install_date_element(name, type, disp_name=name)

[Source]

    # File rss/rss.rb, line 223
        def install_date_element(name, type, disp_name=name)
          self::ELEMENTS << name
          add_need_initialize_variable(name)

          # accessor
          convert_attr_reader name
          date_writer(name, type, disp_name)

          install_element(name) do |n, elem_name|
            "if @\#{n}\nrv = \"\\\#{indent}<\#{elem_name}>\"\nvalue = html_escape(@\#{n}.\#{type})\nif need_convert\nrv << convert(value)\nelse\nrv << value\nend\nrv << \"</\#{elem_name}>\"\nrv\nelse\n''\nend\n"
          end

        end

install_have_attribute_element(name)

Alias for install_have_child_element

install_have_child_element(name)

[Source]

    # File rss/rss.rb, line 161
        def install_have_child_element(name)
          add_need_initialize_variable(name)

          attr_accessor name
          install_element(name) do |n, elem_name|
            "if @\#{n}\n\"\\\#{@\#{n}.to_s(need_convert, indent)}\"\nelse\n''\nend\n"
          end
        end

install_have_children_element(name, plural_name=nil)

[Source]

    # File rss/rss.rb, line 178
        def install_have_children_element(name, plural_name=nil)
          plural_name ||= "#{name}s"
          add_have_children_element(name, plural_name)
          add_plural_form(name, plural_name)

          def_children_accessor(name, plural_name)
          install_element(name, "s") do |n, elem_name|
            "rv = []\n@\#{n}.each do |x|\nvalue = \"\\\#{x.to_s(need_convert, indent)}\"\nrv << value if /\\\\A\\\\s*\\\\z/ !~ value\nend\nrv.join(\"\\n\")\n"
          end
        end

install_text_element(name)

[Source]

    # File rss/rss.rb, line 197
        def install_text_element(name)
          self::ELEMENTS << name
          add_need_initialize_variable(name)

          attr_writer name
          convert_attr_reader name
          install_element(name) do |n, elem_name|
            "if @\#{n}\nrv = \"\\\#{indent}<\#{elem_name}>\"\nvalue = html_escape(@\#{n})\nif need_convert\nrv << convert(value)\nelse\nrv << value\nend\nrv << \"</\#{elem_name}>\"\nrv\nelse\n''\nend\n"
          end
        end

[Validate]