class HQMF::SubsetOperator

Constants

TYPES

Attributes

type[RW]
value[RW]

Public Class Methods

from_json(json) click to toggle source
# File lib/hqmf-model/types.rb, line 285
def self.from_json(json)
  type = json["type"] if json["type"]
  value = HQMF::DataCriteria.convert_value(json["value"]) if json["value"]  
  HQMF::SubsetOperator.new(type,value)
end
new(type,value) click to toggle source

@param [String] type @param [Value] value

# File lib/hqmf-model/types.rb, line 271
def initialize(type,value)
  @type = type
  if (value.is_a? HQMF::Value)
    value.inclusive = true
    @value = HQMF::Range.new('IVL_PQ',value,value,nil)
  else
    @value = value
  end
end

Public Instance Methods

==(other) click to toggle source
# File lib/hqmf-model/types.rb, line 298
def ==(other)
  check_equality(self,other)
end
supports_grouper_criteria?() click to toggle source
# File lib/hqmf-model/types.rb, line 281
def supports_grouper_criteria?
  ['FIRST', 'SECOND', 'THIRD', 'FOURTH', 'FIFTH', 'RECENT', 'LAST'].include? @type
end
to_json() click to toggle source
# File lib/hqmf-model/types.rb, line 292
def to_json
  json = build_hash(self, [:type])
  json[:value] = @value.to_json if @value
  json
end