Sha256: 656afcc6a472eddac3fdc89bbed16697a24be080204f2295d19bf42430f1106f
Contents?: true
Size: 892 Bytes
Versions: 15
Compression:
Stored size: 892 Bytes
Contents
module Mida # Class used to describe a property class PropertyDesc def initialize(num, &block) @num, @types = num, [] if block_given? instance_eval(&block) @types = [DataType::Text] unless @types.size >= 1 else @types = [DataType::Text] end end # What to extract for this property. # This can be a datatype such as +:text+ or a +Vocabulary+. # The types should be supplied in order of preference. # If you want to say any type, then use +:any+ as the class def extract(*types) @types += types end # <b>DEPRECATED:</b> Please use +extract+ instead def types(*types) warn "[DEPRECATION] Mida::PropertyDesc#types is deprecated. "+ "Please use Mida::PropertyDesc#extract instead." extract *types end def to_h {num: @num, types: @types} end end end
Version data entries
15 entries across 15 versions & 2 rubygems