123456789_123456789_123456789_123456789_123456789_

Module: RSS::SetupMaker

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: lib/rss/rss.rb

Instance Method Summary

Instance Method Details

#maker_target(maker) (private)

[ GitHub ]

  
# File 'lib/rss/rss.rb', line 626

def maker_target(maker)
  nil
end

#not_need_to_call_setup_maker_variables (private)

[ GitHub ]

  
# File 'lib/rss/rss.rb', line 649

def not_need_to_call_setup_maker_variables
  []
end

#setup_maker(maker)

[ GitHub ]

  
# File 'lib/rss/rss.rb', line 616

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 630

def setup_maker_attributes(target)
end

#setup_maker_element(target) (private)

[ GitHub ]

  
# File 'lib/rss/rss.rb', line 633

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 653

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