Sha256: 8828531f6a1e62b78d07f20bb01657d2f2751678b54bce69746af8f9f9632757
Contents?: true
Size: 753 Bytes
Versions: 12
Compression:
Stored size: 753 Bytes
Contents
module Mspire UserParam = Struct.new(:name, :value, :type, :unit) class UserParam # returns nil def accession # that way all params can be queried by accession and not raise error nil end # takes a few different incantations: # # name, unit_acc# or CV::Param object # name, value, unit_acc# or CV::Param object # name, value, type, unit_acc# or CV::Param object def initialize(*args) self.unit = if args.size > 1 && ((args.last.is_a?(::CV::Param) || args.last =~ /^[A-Za-z]+:\d+$/)) unit_arg = args.pop unit_arg.is_a?(::CV::Param) ? unit_arg : Mspire::CV::Param[unit_arg] end self.name, self.value, self.type = args end end end
Version data entries
12 entries across 12 versions & 1 rubygems