Skip to content

(MODULES-9049) Add type alias for 'yes' and 'no'.#1017

Merged
tphoney merged 1 commit intopuppetlabs:masterfrom
ghoneycutt:9049_yes_no
Aug 27, 2019
Merged

(MODULES-9049) Add type alias for 'yes' and 'no'.#1017
tphoney merged 1 commit intopuppetlabs:masterfrom
ghoneycutt:9049_yes_no

Conversation

@ghoneycutt
Copy link
Copy Markdown
Contributor

No description provided.

@ghoneycutt
Copy link
Copy Markdown
Contributor Author

@ghoneycutt
Copy link
Copy Markdown
Contributor Author

Could someone please take a look, thank you!

@hlindberg
Copy link
Copy Markdown
Contributor

I think this is fine - it would be nice to make them case independent which could be done by using a Pattern data type with a regexp where the case independent flag is turned on.
For example:

type YesNo = Pattern[/\A(?i:(yes|no))\z/]

This works hand in hand with Boolean($val) since it turns a yes/no into boolean in the same case independent way.

@ghoneycutt
Copy link
Copy Markdown
Contributor Author

Good idea Henrik. I'll get the PR amended.

@ghoneycutt
Copy link
Copy Markdown
Contributor Author

@hlindberg look good?

@tphoney
Copy link
Copy Markdown
Contributor

tphoney commented Aug 27, 2019

Looks good to me, Merging.

Thanks for the PR @ghoneycutt

@tphoney tphoney merged commit f34f284 into puppetlabs:master Aug 27, 2019
@ghoneycutt ghoneycutt deleted the 9049_yes_no branch January 25, 2021 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants