Class: ForestLiana::Utils::BetaSchemaUtils

Inherits:
Object
  • Object
show all
Defined in:
app/services/forest_liana/utils/beta_schema_utils.rb

Class Method Summary collapse

Class Method Details

.find_action_from_endpoint(collection_name, endpoint, http_method) ⇒ Object



4
5
6
7
8
9
10
# File 'app/services/forest_liana/utils/beta_schema_utils.rb', line 4

def self.find_action_from_endpoint(collection_name, endpoint, http_method)
  collection = ForestLiana.apimap.find { |collection| collection.name.to_s == collection_name }

  return nil unless collection

  collection.actions.find { |action| (action.endpoint == endpoint || "/#{action.endpoint}" == endpoint) && action.http_method == http_method }
end