Module
Instance Methods
lib/rss/maker/atom.rb
View on GitHub
# File tmp/rubies/ruby-2.3.8/lib/rss/maker/atom.rb, line 10
def def_atom_persons(klass, name, maker_name, plural=nil)
plural ||= "#{name}s"
klass_name = Utils.to_class_name(name)
plural_klass_name = Utils.to_class_name(plural)
klass.class_eval(<<-EOC, __FILE__, __LINE__ + 1)
class #{plural_klass_name} < #{plural_klass_name}Base
class #{klass_name} < #{klass_name}Base
def to_feed(feed, current)
#{name} = feed.class::#{klass_name}.new
set = setup_values(#{name})
unless set
raise NotSetError.new(#{maker_name.dump},
not_set_required_variables)
end
current.#{plural} << #{name}
set_parent(#{name}, current)
setup_other_elements(#{name})
end
private
def required_variable_names
%w(name)
end
end
end
EOC
end
No documentation available