dpickett / has_barcode

Nice class method wrapper for barby
MIT License
52 stars 18 forks source link

specifically setting the class name #2

Closed Reprazent closed 11 years ago

Reprazent commented 12 years ago

Since the class EAN13 is in capitals, I needed to set the classname manually. This can now be done like this:

  has_barcode( :barcode,
               :type => :ean_13,
               :outputter => :png,
               :value => Proc.new { |c| c.padded_number },
               :barcode_class_name => "EAN13")

When "barcode_class_name" isn't given the fallback "type" is used like before

dpickett commented 12 years ago

wow, thanks for the pull request!

why not explicitly set :type => Barby::EAN13? I'd be in favor of a design like that

dpickett commented 11 years ago

I'm closing this out, but I like the pattern of explicitly setting the type.

kevinelliott commented 11 years ago

It looks like this got dumped. How can I use ean_13? Very strange that there is no way to do this now.