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

Enhancements to Attribute options #37

Open
careo opened this issue Oct 31, 2013 · 0 comments
Open

Enhancements to Attribute options #37

careo opened this issue Oct 31, 2013 · 0 comments
Milestone

Comments

@careo
Copy link
Contributor

careo commented Oct 31, 2013

  1. Support array of regular expressions to use for value validation. Either Attribute could accept a list of regular expressions here, or we could provide some way for the type to override the type to override that behavior (so at least String can take an array of regexes).
  2. Validate that :values are valid
  3. Validate that :default is valid
  4. And make the part of check_option below less weird.

Weird part:

unless self.type.valid_type?(definition) || definition.is_a?(::Regexp) || definition.is_a?(::String) || definition.is_a?(::Array)
  raise AttributorException.new("Invalid example type (got: #{definition.class.name}). It must always match the type of the attribute (except if passing Regex that is allowed for some types)")
end
@careo careo modified the milestone: v3.0 Sep 15, 2014
@careo careo modified the milestones: v4.3, v3.0 Nov 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant