Coder Social home page Coder Social logo

snail's People

Contributors

bousquet avatar cainlevy avatar dlepage avatar ibrittanyhill avatar joshuapinter avatar tiegz avatar tinynumbers avatar willisplummer avatar yob avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

snail's Issues

Addressing for The Netherlands

Hi there,

First off: great gem! Unfortunately the notation for the Netherlands is incorrect. We (as I live in the Netherlands) don't use our regions (provinces) for postal. So you can just leave them out.

when 'Netherlands'
      "#{postal_code} #{region} #{city}"

should become (not the two spaces between postal_code and city)

when 'Netherlands'
      "#{postal_code}  #{city}"

How to format company address containing person name?

Thanks for this gem!

I'm just wondering how to format addresses containing a company name and a person name.

In Germany, we'd typically put the company name on the first line, followed by the person's name on the next line.

What's the international way of dealing with this? Can Snail handle it in any way?

This does work...

Snail.new(
  :name => "Jon Doe c/o Doe Inc.",
  :line_1 => "12345 Somewhere Ln",
  :line_2 => nil,
  :city => "Bentley",
  :region => "WA",
  :postal_code => "6102",
  :country => "AU"
).to_s

...but isn't there a better way?

Always display the country line

Hey @cainlevy,

Currently the home_country is used to determine whether we should display the country line. I believe it is too restrictive and before opening a PR, I would like to discuss with you about it.

In some cases, printing the country line is required. Think about an invoice for instance, the company address printed (home_country) might be different from the billing/delivery address country (destination).
For an international invoice, the company country should be printed but it is not the case since the home_country property is specified. Also, the home_country property always fallback to US (https://github.com/cainlevy/snail/blob/master/lib/snail.rb#L61).

To avoid breaking changes, I was thinking about adding another property, something like skip_country_line which will be true by default. You will be able to override it like home_country: Snail.skip_country_line = false

Let me know your thoughts.

Cheers.

address 'to_html' should not be wrapped in 'address' tag

Snail's "to_html" method should not wrap the resulting address in an HTML <address> tag. According to the spec:

The address element provides contact information for a document or part of a document. Information provided by address may include the names of the document’s maintainers, links to the maintainers’ Web pages, e-mail addresses for feedback, postal addresses, phone numbers, and so on. The address element is not appropriate for all postal and e-mail addresses; it should be reserved for providing such information about the contact people for the document.

I think it would be best to allow the caller to determine what block-level element in which to wrap the resulting HTML-formatted addresss.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.