Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URI example does not abide by the :path option #151

Open
blanquer opened this issue Dec 14, 2015 · 0 comments
Open

URI example does not abide by the :path option #151

blanquer opened this issue Dec 14, 2015 · 0 comments

Comments

@blanquer
Copy link
Contributor

class Test < Attributor::Struct
  attributes do
    attribute :href, Attributor::URI, path: %r{/foo/\d+}
  end
end

puts Test.example.dump
 => {:href=>"http://example.com/hydrocoralline/804302141"}

Although, it would correctly validate against it:

t = Test.load( {href: "/bar/123"} )
puts t.validate
=> $.href value (/bar/123) does not match path (/\/foo\/\d+/)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant