Class: PlatformosCheck::PlatformosLiquid::SourceIndex

Inherits:
Object
  • Object
show all
Defined in:
lib/platformos_check/platformos_liquid/source_index.rb,
lib/platformos_check/platformos_liquid/source_index/tag_entry.rb,
lib/platformos_check/platformos_liquid/source_index/tag_state.rb,
lib/platformos_check/platformos_liquid/source_index/base_entry.rb,
lib/platformos_check/platformos_liquid/source_index/base_state.rb,
lib/platformos_check/platformos_liquid/source_index/filter_entry.rb,
lib/platformos_check/platformos_liquid/source_index/filter_state.rb,
lib/platformos_check/platformos_liquid/source_index/object_entry.rb,
lib/platformos_check/platformos_liquid/source_index/object_state.rb,
lib/platformos_check/platformos_liquid/source_index/property_entry.rb,
lib/platformos_check/platformos_liquid/source_index/parameter_entry.rb,
lib/platformos_check/platformos_liquid/source_index/return_type_entry.rb

Defined Under Namespace

Classes: BaseEntry, BaseState, FilterEntry, FilterState, ObjectEntry, ObjectState, ParameterEntry, PropertyEntry, ReturnTypeEntry, TagEntry, TagState

Class Method Summary collapse

Class Method Details

.deprecated_filtersObject



51
52
53
# File 'lib/platformos_check/platformos_liquid/source_index.rb', line 51

def deprecated_filters
  @deprecated_filters ||= load_file("../deprecated_filters")
end

.filtersObject



10
11
12
13
14
15
16
# File 'lib/platformos_check/platformos_liquid/source_index.rb', line 10

def filters
  @filters = nil if FilterState.outdated?

  @filters ||= FilterState.mark_up_to_date &&
               load_file(:filters)
               .map { |hash| FilterEntry.new(hash) }
end

.labels_only_exposed_in_certain_contextsObject



47
48
49
# File 'lib/platformos_check/platformos_liquid/source_index.rb', line 47

def labels_only_exposed_in_certain_contexts
  %w[robots app].freeze
end

.objectsObject



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/platformos_check/platformos_liquid/source_index.rb', line 18

def objects
  @objects = nil if ObjectState.outdated?

  @objects ||= ObjectState.mark_up_to_date &&
               load_file(:objects)
               .concat(built_in_objects)
               .filter_map do |hash|
                 next if labels_only_exposed_in_certain_contexts.include?(hash['name'])

                 ObjectEntry.new(hash)
               end
end

.platformos_app_app_extension_labelsObject



43
44
45
# File 'lib/platformos_check/platformos_liquid/source_index.rb', line 43

def platformos_app_app_extension_labels
  @platformos_app_app_extension_labels ||= load_file("../platformos_app_app_extension_labels")
end

.plus_labelsObject



39
40
41
# File 'lib/platformos_check/platformos_liquid/source_index.rb', line 39

def plus_labels
  @plus_objects ||= load_file("../plus_labels")
end

.tagsObject



31
32
33
34
35
36
37
# File 'lib/platformos_check/platformos_liquid/source_index.rb', line 31

def tags
  @tags = nil if TagState.outdated?

  @tags ||= TagState.mark_up_to_date &&
            load_file(:tags)
            .map { |hash| TagEntry.new(hash) }
end