Class: Lutaml::Model::UninitializedClass

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/lutaml/model/uninitialized_class.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *_args, &_block) ⇒ Object



51
52
53
54
55
56
57
# File 'lib/lutaml/model/uninitialized_class.rb', line 51

def method_missing(method, *_args, &_block)
  if method.end_with?("?")
    false
  else
    super
  end
end

Instance Method Details

#encodingObject



46
47
48
49
# File 'lib/lutaml/model/uninitialized_class.rb', line 46

def encoding
  # same as default encoding for string
  "".encoding
end

#gsub(_, _) ⇒ Object



30
31
32
# File 'lib/lutaml/model/uninitialized_class.rb', line 30

def gsub(_, _)
  self
end

#include?(_args) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/lutaml/model/uninitialized_class.rb', line 26

def include?(_args)
  false
end

#inspectObject



14
15
16
# File 'lib/lutaml/model/uninitialized_class.rb', line 14

def inspect
  "uninitialized"
end

#match?(_args) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/lutaml/model/uninitialized_class.rb', line 22

def match?(_args)
  false
end

#respond_to_missing?(method_name, _include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/lutaml/model/uninitialized_class.rb', line 59

def respond_to_missing?(method_name, _include_private = false)
  method_name.end_with?("?")
end

#sizeObject



42
43
44
# File 'lib/lutaml/model/uninitialized_class.rb', line 42

def size
  0
end

#to_fObject



38
39
40
# File 'lib/lutaml/model/uninitialized_class.rb', line 38

def to_f
  self
end

#to_sObject



10
11
12
# File 'lib/lutaml/model/uninitialized_class.rb', line 10

def to_s
  self
end

#to_yamlObject



34
35
36
# File 'lib/lutaml/model/uninitialized_class.rb', line 34

def to_yaml
  nil
end

#uninitialized?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/lutaml/model/uninitialized_class.rb', line 18

def uninitialized?
  true
end