Method: Eddy::Models::Element::TM#initialize
- Defined in:
- lib/eddy/models/element/tm.rb
#initialize(min: nil, max: nil, req: nil, ref: nil, val: nil, fmt: nil) ⇒ void
TM elements require either a fmt value, or min and max values.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/eddy/models/element/tm.rb', line 33 def initialize( min: nil, max: nil, req: nil, ref: nil, val: nil, fmt: nil ) @type = "TM" @min = min @max = max self.req = req self.ref = ref if fmt.nil? raise ArgumentError, "TM elements require either a `fmt` value, or `min` and `max` values." if min.nil? || max.nil? @fmt = determine_format() else self.fmt = fmt end self.value = val end |