Class: RSS::Maker::ItemsBase

Inherits:
Base
  • Object
show all
Defined in:
lib/rss/maker/base.rb,
lib/rss/maker/image.rb,
lib/rss/maker/slash.rb,
lib/rss/maker/itunes.rb,
lib/rss/maker/content.rb,
lib/rss/maker/taxonomy.rb,
lib/rss/maker/trackback.rb,
lib/rss/maker/dublincore.rb

Defined Under Namespace

Classes: ItemBase

Constant Summary

Constants inherited from Base

Base::NEED_INITIALIZE_VARIABLES, Base::OTHER_ELEMENTS

Instance Attribute Summary collapse

Attributes inherited from Base

#maker

Instance Method Summary collapse

Methods inherited from Base

add_need_initialize_variable, add_other_element, def_array_element, def_classed_element, def_classed_element_without_accessor, def_classed_elements, def_csv_element, def_other_element, def_other_element_without_accessor, #have_required_values?, inherited, inherited_base, need_initialize_variables, other_elements, #variable_is_set?

Methods included from Utils::InheritedReader

#inherited_array_reader, #inherited_hash_reader, #inherited_reader

Constructor Details

#initialize(maker) ⇒ ItemsBase

Returns a new instance of ItemsBase.



676
677
678
679
680
# File 'lib/rss/maker/base.rb', line 676

def initialize(maker)
  super
  @do_sort = false
  @max_size = -1
end

Instance Attribute Details

#do_sortObject

Returns the value of attribute do_sort.



674
675
676
# File 'lib/rss/maker/base.rb', line 674

def do_sort
  @do_sort
end

#max_sizeObject

Returns the value of attribute max_size.



674
675
676
# File 'lib/rss/maker/base.rb', line 674

def max_size
  @max_size
end

Instance Method Details

#normalizeObject



682
683
684
685
686
687
688
# File 'lib/rss/maker/base.rb', line 682

def normalize
  if @max_size >= 0
    sort_if_need[0...@max_size]
  else
    sort_if_need[0..@max_size]
  end
end