Skip to content

Adds support for enums as id and resource.#5

Merged
mitnal merged 5 commits into
masterfrom
feature/uri_id_and_resource_as_enum
Aug 9, 2019
Merged

Adds support for enums as id and resource.#5
mitnal merged 5 commits into
masterfrom
feature/uri_id_and_resource_as_enum

Conversation

@mitnal

@mitnal mitnal commented Aug 6, 2019

Copy link
Copy Markdown
Contributor

Adds ability to define multiple possible values for id and resource.

MyURI = URI.build(schema: 'com.example', context: 'billing', resource: %w[invoice invoice_duplicate], id: %w[final past_due])
MyURI.build('com.example:billing:invoice:pro_forma') # => InvalidURI

# with types extension

MyURI.new(id: 'pro_forma') # => Dry::Types::ConstraintError

# default is first value

MyURI.new(id: 'final') # => #<MyURI 'com.example:billing:invoice:final'>

@mitnal mitnal self-assigned this Aug 6, 2019
@codecov

codecov Bot commented Aug 6, 2019

Copy link
Copy Markdown

Codecov Report

Merging #5 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master     #5   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          10     10           
  Lines         293    365   +72     
=====================================
+ Hits          293    365   +72
Impacted Files Coverage Δ
lib/studitemps/utils/uri.rb 100% <100%> (ø) ⬆️
lib/studitemps/utils/uri/base.rb 100% <100%> (ø) ⬆️
spec/studitemps/uri_spec.rb 100% <100%> (ø) ⬆️
lib/studitemps/utils/uri/builder.rb 100% <100%> (ø) ⬆️
lib/studitemps/utils/uri/extensions/types.rb 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a717237...d300eac. Read the comment docs.

@mitnal mitnal marked this pull request as ready for review August 9, 2019 13:13
@mitnal mitnal merged commit 5c369ee into master Aug 9, 2019
@mitnal mitnal deleted the feature/uri_id_and_resource_as_enum branch August 9, 2019 13:14
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

Successfully merging this pull request may close these issues.

1 participant