Class: Stupidedi::Schema::SegmentReq
- Inherits:
-
Object
- Object
- Stupidedi::Schema::SegmentReq
- Defined in:
- lib/stupidedi/schema/segment_req.rb
Overview
The 5010 X12 “data segment requirement designator”s include
M - Mandatory
O - Optional
The HIPAA implementation guides “industry usage” include
SITUATIONAL
REQUIRED
Instance Method Summary collapse
- #forbidden? ⇒ Boolean
-
#initialize(required, forbidden, to_s) ⇒ SegmentReq
constructor
A new instance of SegmentReq.
- #inspect ⇒ String
- #optional? ⇒ Boolean
- #pretty_print(q) ⇒ void
- #required? ⇒ Boolean
Constructor Details
#initialize(required, forbidden, to_s) ⇒ SegmentReq
Returns a new instance of SegmentReq.
18 19 20 21 |
# File 'lib/stupidedi/schema/segment_req.rb', line 18 def initialize(required, forbidden, to_s) @required, @forbidden, @to_s = required, forbidden, to_s end |
Instance Method Details
#forbidden? ⇒ Boolean
27 28 29 |
# File 'lib/stupidedi/schema/segment_req.rb', line 27 def forbidden? @forbidden end |
#inspect ⇒ String
41 42 43 |
# File 'lib/stupidedi/schema/segment_req.rb', line 41 def inspect @to_s end |
#optional? ⇒ Boolean
31 32 33 |
# File 'lib/stupidedi/schema/segment_req.rb', line 31 def optional? not (@required or @forbidden) end |
#pretty_print(q) ⇒ void
This method returns an undefined value.
36 37 38 |
# File 'lib/stupidedi/schema/segment_req.rb', line 36 def pretty_print(q) q.text @to_s end |
#required? ⇒ Boolean
23 24 25 |
# File 'lib/stupidedi/schema/segment_req.rb', line 23 def required? @required end |