Make method name consistent in embedded video component

We were using `reg_exp` as the method name, when it returned
`VIMEO_REGEX` or `YOUTUBE_REGEX`.

So using `regex` as the method name is less confusing.
This commit is contained in:
Javi Martín
2024-05-19 04:49:10 +02:00
parent fee5b8a13c
commit cc8acdcc87

View File

@@ -33,7 +33,7 @@ class Shared::EmbeddedVideoComponent < ApplicationComponent
end
end
def reg_exp
def regex
if server == "Vimeo"
record.class::VIMEO_REGEX
elsif server == "YouTube"
@@ -50,7 +50,7 @@ class Shared::EmbeddedVideoComponent < ApplicationComponent
end
def match
@match ||= link.match(reg_exp) if reg_exp
@match ||= link.match(regex) if regex
end
def iframe_attributes