Module: RSS::SetupMaker
Instance Method Summary
- #setup_maker(maker)
- #maker_target(maker) private
- #not_need_to_call_setup_maker_variables private
- #setup_maker_attributes(target) private
- #setup_maker_element(target) private
- #setup_maker_elements(parent) private
Instance Method Details
#maker_target(maker) (private)
[ GitHub ]# File 'lib/rss/rss.rb', line 632
def maker_target(maker) nil end
#not_need_to_call_setup_maker_variables (private)
[ GitHub ]# File 'lib/rss/rss.rb', line 655
def not_need_to_call_setup_maker_variables [] end
#setup_maker(maker)
[ GitHub ]# File 'lib/rss/rss.rb', line 622
def setup_maker(maker) target = maker_target(maker) unless target.nil? setup_maker_attributes(target) setup_maker_element(target) setup_maker_elements(target) end end
#setup_maker_attributes(target) (private)
[ GitHub ]# File 'lib/rss/rss.rb', line 636
def setup_maker_attributes(target) end
#setup_maker_element(target) (private)
[ GitHub ]# File 'lib/rss/rss.rb', line 639
def setup_maker_element(target) self.class.need_initialize_variables.each do |var| value = __send__(var) next if value.nil? if value.respond_to?("setup_maker") and !not_need_to_call_setup_maker_variables.include?(var) value.setup_maker(target) else setter = "#{var}=" if target.respond_to?(setter) target.__send__(setter, value) end end end end
#setup_maker_elements(parent) (private)
[ GitHub ]# File 'lib/rss/rss.rb', line 659
def setup_maker_elements(parent) self.class.have_children_elements.each do |name, plural_name| if parent.respond_to?(plural_name) target = parent.__send__(plural_name) __send__(plural_name).each do |elem| elem.setup_maker(target) end end end end