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

Adding 'alias-field' method for segments #35

Merged
merged 1 commit into from
Oct 1, 2014
Merged

Conversation

mogox
Copy link
Member

@mogox mogox commented Sep 15, 2014

This PR adds the alias-field functionality which is required to fix #14 .

The method alias-field would work like this:

class MockSegment < HL7::Message::Segment
   weight 1
   add_field :no_block
   alias_field :no_block_alias, :no_block
   add_field :validating do |value|
     value == "bad" ? nil : value
   end
end

base = "Mock|no_block|validated|converted"
msg = MockSegment.new(base)
msg.no_block        #output => "no_block"
msg.no_block_alias  #output => "no_block"

Hey @rojotek, @Stratus3D, @jgn Would you mind taking a look at this?

@rojotek
Copy link
Contributor

rojotek commented Oct 1, 2014

Seems reasonable to me.

mogox added a commit that referenced this pull request Oct 1, 2014
Adding 'alias-field' method for segments
@mogox mogox merged commit 382abe0 into master Oct 1, 2014
@mogox
Copy link
Member Author

mogox commented Oct 1, 2014

Thanks for the review @rojotek

@mogox mogox mentioned this pull request Dec 15, 2014
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.

Question: segment field names
2 participants