Class: Expressir::Liquid::Declarations::SchemaDrop
Instance Method Summary
collapse
#id, #initialize_identifier, #remark_items, #source
#_class, #source
Constructor Details
#initialize(model, selected_schemas: nil, options: {}) ⇒ SchemaDrop
rubocop:disable Lint/MissingSuper
9
10
11
12
13
14
15
|
# File 'lib/expressir/liquid/declarations/schema_drop.rb', line 9
def initialize(model, selected_schemas: nil, options: {}) @model = model
@selected_schemas = selected_schemas
@options = options
initialize_identifier(@model)
super(model)
end
|
Instance Method Details
#constants ⇒ Object
69
70
71
72
73
74
75
|
# File 'lib/expressir/liquid/declarations/schema_drop.rb', line 69
def constants
return [] unless @model.constants
@model.constants.map do |item|
::Expressir::Liquid::Declarations::ConstantDrop.new(item)
end
end
|
#entities ⇒ Object
85
86
87
88
89
90
91
|
# File 'lib/expressir/liquid/declarations/schema_drop.rb', line 85
def entities
return [] unless @model.entities
@model.entities.map do |item|
::Expressir::Liquid::Declarations::EntityDrop.new(item)
end
end
|
#file ⇒ Object
17
18
19
|
# File 'lib/expressir/liquid/declarations/schema_drop.rb', line 17
def file
@model.file
end
|
#file_basename ⇒ Object
21
22
23
|
# File 'lib/expressir/liquid/declarations/schema_drop.rb', line 21
def file_basename
File.basename(@model.file, ".exp")
end
|
125
126
127
|
# File 'lib/expressir/liquid/declarations/schema_drop.rb', line 125
def formatted
@model.to_s(no_remarks: true)
end
|
#functions ⇒ Object
101
102
103
104
105
106
107
|
# File 'lib/expressir/liquid/declarations/schema_drop.rb', line 101
def functions
return [] unless @model.functions
@model.functions.map do |item|
::Expressir::Liquid::Declarations::FunctionDrop.new(item)
end
end
|
#interfaces ⇒ Object
61
62
63
64
65
66
67
|
# File 'lib/expressir/liquid/declarations/schema_drop.rb', line 61
def interfaces
return [] unless @model.interfaces
@model.interfaces.map do |item|
::Expressir::Liquid::Declarations::InterfaceDrop.new(item)
end
end
|
#procedures ⇒ Object
117
118
119
120
121
122
123
|
# File 'lib/expressir/liquid/declarations/schema_drop.rb', line 117
def procedures
return [] unless @model.procedures
@model.procedures.map do |item|
::Expressir::Liquid::Declarations::ProcedureDrop.new(item)
end
end
|
#relative_path_prefix ⇒ Object
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/expressir/liquid/declarations/schema_drop.rb', line 30
def relative_path_prefix
return nil if @options.nil? || @options["document"].nil?
document = @options["document"]
file_path = File.dirname(@model.file)
docfile_directory = File.dirname(
document.attributes["docfile"] || ".",
)
document
.path_resolver
.system_path(file_path, docfile_directory)
end
|
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/expressir/liquid/declarations/schema_drop.rb', line 43
def
return [] unless @model.
options = @options || {}
options["relative_path_prefix"] = relative_path_prefix
@model..map do ||
::Expressir::Express::ExpressRemarksDecorator
.call(, options)
end
end
|
#rules ⇒ Object
109
110
111
112
113
114
115
|
# File 'lib/expressir/liquid/declarations/schema_drop.rb', line 109
def rules
return [] unless @model.rules
@model.rules.map do |item|
::Expressir::Liquid::Declarations::RuleDrop.new(item)
end
end
|
#selected ⇒ Object
25
26
27
28
|
# File 'lib/expressir/liquid/declarations/schema_drop.rb', line 25
def selected
@selected_schemas&.include?(@model.id) ||
@selected_schemas&.include?(file_basename)
end
|
#subtype_constraints ⇒ Object
93
94
95
96
97
98
99
|
# File 'lib/expressir/liquid/declarations/schema_drop.rb', line 93
def subtype_constraints
return [] unless @model.subtype_constraints
@model.subtype_constraints.map do |item|
::Expressir::Liquid::Declarations::SubtypeConstraintDrop.new(item)
end
end
|
#types ⇒ Object
77
78
79
80
81
82
83
|
# File 'lib/expressir/liquid/declarations/schema_drop.rb', line 77
def types
return [] unless @model.types
@model.types.map do |item|
::Expressir::Liquid::Declarations::TypeDrop.new(item)
end
end
|