Mystery ruby syntax (with "string" do) -


i'm doing work on a third-party project. self.configure block enormous, , contains number of with statements, e.g.:

def self.configure      'ead' |node|         make :resource     end      ignore 'titlepage'      'archdesc'          # etc 

this looks switch statement somehow built method's argument section, i've never seen syntax before. here know going on?

it's method taking string , block:

https://github.com/archivesspace/archivesspace/blob/fb860a81f70a98eb489564b6e17d2c120c40fc5f/backend/app/converters/lib/xml_sax.rb#l25

it's defining xml tag handlers:

def with(path, &block)   define_method(handler_name(path), block) end 

Comments