Class: HQMF::AnyValue

Inherits:
Object
  • Object
show all
Includes:
Conversion::Utilities
Defined in:
lib/hqmf-model/types.rb

Overview

Used to represent ‘any value’ in criteria that require a value be present but don’t specify any restrictions on that value

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Conversion::Utilities

#build_hash, #check_equality, #json_array, #openstruct_to_json

Constructor Details

#initialize(type = 'ANYNonNull') ⇒ AnyValue

Returns a new instance of AnyValue.



9
10
11
# File 'lib/hqmf-model/types.rb', line 9

def initialize(type='ANYNonNull')
  @type = type 
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



7
8
9
# File 'lib/hqmf-model/types.rb', line 7

def type
  @type
end

Class Method Details

.from_json(json) ⇒ Object



17
18
19
20
# File 'lib/hqmf-model/types.rb', line 17

def self.from_json(json)
  type = json["type"] || 'ANYNonNull'
  HQMF::AnyValue.new(type)
end

Instance Method Details

#derived?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/hqmf-model/types.rb', line 13

def derived?
  false
end

#to_jsonObject



22
23
24
25
# File 'lib/hqmf-model/types.rb', line 22

def to_json
  hash = build_hash(self, [:type])
  hash
end