Skip to content

Commit

Permalink
Merge branch 'master' into gh-189
Browse files Browse the repository at this point in the history
  • Loading branch information
kputnam committed May 31, 2019
2 parents c1d35ed + cc8c47c commit 7de2d0a
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ before_install:
else
gem update --system;
gem install bundler;
bundle update --bundler;
fi

rvm:
Expand Down Expand Up @@ -34,3 +35,4 @@ rvm:
- 2.5.1
- 2.5.3
- 2.6.3
- 2.7.0-preview1
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ v master / unreleased

* Fix copy-pasted StringVal -> IdentifierVal #187
* call find! on StateMachine not Either wrapper #188
* Fix error message when required composite is missing #194

v 1.4.0

Expand Down
2 changes: 1 addition & 1 deletion bin/edi-obfuscate
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def main(argv)
end
end.compact

puts token.copy(element_toks: element_toks).to_s(delims)
puts token.copy(element_toks: element_toks).to_x12(delims)
else
raise "unknown segment: #{token.id}" if strict
next
Expand Down
9 changes: 9 additions & 0 deletions lib/stupidedi/schema/abstract_element_use.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ class AbstractElementUse < AbstractUse

def_delegators :definition, :code_lists

# @return [Symbol]
abstract :id

# @return [String]
abstract :name

# @return [String]
abstract :description

# @return [ElementReq]
abstract :requirement

Expand Down
2 changes: 2 additions & 0 deletions lib/stupidedi/schema/component_element_use.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class ComponentElementUse < AbstractElementUse
# @return [SimpleElementDef]
attr_reader :definition

def_delegators :definition, :id, :name, :description

# @return [ElementReq]
attr_reader :requirement

Expand Down
2 changes: 1 addition & 1 deletion lib/stupidedi/schema/composite_element_use.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class CompositeElementUse < AbstractElementUse
# @return [CompositeElementDef]
attr_reader :definition

def_delegators :definition, :id
def_delegators :definition, :id, :name, :description

# @return [ElementReq]
attr_reader :requirement
Expand Down
8 changes: 4 additions & 4 deletions lib/stupidedi/schema/segment_use.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ class SegmentUse < AbstractUse
# @return [SegmentDef]
attr_reader :definition

def_delegators :definition, :id, :name, :descriptor, :code_lists

# @see X222 B.1.1.3.12.6 Data Segment Requirement Designators
#
# @return [SegmentReq]
attr_reader :requirement

def_delegators :requirement, :required?, :optional?

# @see X222 B.1.3.12.3 Repeated Occurrences of Single Data Segments
# @see X222 B.1.3.12.8 Data Segment Occurrence
#
Expand All @@ -31,10 +35,6 @@ class SegmentUse < AbstractUse
# @return [LoopDef, TableDef]
attr_reader :parent

def_delegators :definition, :descriptor, :id, :name, :code_lists

def_delegators :requirement, :required?, :optional?

def initialize(definition, position, requirement, repeat_count, parent)
@definition, @position, @requirement, @repeat_count, @parent =
definition, position, requirement, repeat_count, parent
Expand Down
2 changes: 2 additions & 0 deletions lib/stupidedi/schema/simple_element_use.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class SimpleElementUse < AbstractElementUse
# @return [SimpleElementDef]
attr_reader :definition

def_delegators :definition, :id, :name, :description

# @return [ElementReq]
attr_reader :requirement

Expand Down
2 changes: 1 addition & 1 deletion lib/stupidedi/values/repeated_element_val.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def pretty_print(q)

# @return [Boolean]
def ==(other)
eql?(other)
eql?(other) or \
(other.definition == definition and
other.children == @children)
end
Expand Down

0 comments on commit 7de2d0a

Please sign in to comment.