Class: HQMF::SubsetOperator
- Inherits:
-
Object
- Object
- HQMF::SubsetOperator
- Includes:
- Conversion::Utilities
- Defined in:
- lib/hqmf-model/types.rb
Constant Summary collapse
- TYPES =
['COUNT', 'FIRST', 'SECOND', 'THIRD', 'FOURTH', 'FIFTH', 'RECENT', 'LAST', 'MIN', 'MAX', 'DATEDIFF', 'TIMEDIFF', 'MEDIAN', 'MEAN']
Instance Attribute Summary collapse
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(type, value) ⇒ SubsetOperator
constructor
A new instance of SubsetOperator.
- #to_json ⇒ Object
Methods included from Conversion::Utilities
#build_hash, #check_equality, #json_array, #openstruct_to_json
Constructor Details
permalink #initialize(type, value) ⇒ SubsetOperator
Returns a new instance of SubsetOperator.
265 266 267 268 269 270 271 272 273 |
# File 'lib/hqmf-model/types.rb', line 265 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 |
Instance Attribute Details
permalink #type ⇒ Object
Returns the value of attribute type.
262 263 264 |
# File 'lib/hqmf-model/types.rb', line 262 def type @type end |
permalink #value ⇒ Object
Returns the value of attribute value.
262 263 264 |
# File 'lib/hqmf-model/types.rb', line 262 def value @value end |
Class Method Details
permalink .from_json(json) ⇒ Object
[View source]
275 276 277 278 279 280 |
# File 'lib/hqmf-model/types.rb', line 275 def self.from_json(json) type = json["type"] if json["type"] value = HQMF::Range.from_json(json["value"]) if json["value"] HQMF::SubsetOperator.new(type,value) end |
Instance Method Details
permalink #==(other) ⇒ Object
[View source]
290 291 292 |
# File 'lib/hqmf-model/types.rb', line 290 def ==(other) check_equality(self,other) end |
permalink #to_json ⇒ Object
[View source]
283 284 285 286 287 288 |
# File 'lib/hqmf-model/types.rb', line 283 def to_json x = nil json = build_hash(self, [:type]) json[:value] = @value.to_json if @value json end |