Class: Hubspot::Helpers::Path

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot/helpers/path.rb

Instance Method Summary collapse

Instance Method Details

#format(module_name) ⇒ Object



6
7
8
# File 'lib/hubspot/helpers/path.rb', line 6

def format(module_name)
  Hubspot::Helpers::SnakeCase.new.format(module_name.to_s)
end

#require_with_codegen_mapping(path) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/hubspot/helpers/path.rb', line 14

def require_with_codegen_mapping(path)
  require path
    .gsub('o_auth', 'oauth')
    .gsub('audit_logs/', 'audit-logs/')
    .gsub('blog_posts/', 'blog-posts/')
    .gsub('site_search', 'site-search')
    .gsub('source_code/', 'source-code/')
    .gsub('url_redirects', 'url-redirects')
    .gsub('visitor_identification', 'visitor-identification')
end

#require_with_mapping(path) ⇒ Object



10
11
12
# File 'lib/hubspot/helpers/path.rb', line 10

def require_with_mapping(path)
  require path.gsub('o_auth', 'oauth')
end