Class: AePageObjects::RakeRouter::Route

Inherits:
Object
  • Object
show all
Defined in:
lib/ae_page_objects/core/rake_router.rb

Instance Method Summary collapse

Constructor Details

#initialize(spec, mounted_prefix) ⇒ Route

Returns a new instance of Route.



137
138
139
140
# File 'lib/ae_page_objects/core/rake_router.rb', line 137

def initialize(spec, mounted_prefix)
  @path = Path.new(mounted_prefix + spec)
  @path.freeze
end

Instance Method Details

#generate_path(options) ⇒ Object



146
147
148
149
# File 'lib/ae_page_objects/core/rake_router.rb', line 146

def generate_path(options)
  options = HashSymbolizer.new(options).symbolize_keys
  @path.generate(options)
end

#matches?(url) ⇒ Boolean

Returns:

  • (Boolean)


142
143
144
# File 'lib/ae_page_objects/core/rake_router.rb', line 142

def matches?(url)
  url =~ @path.regex
end