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.



135
136
137
138
# File 'lib/ae_page_objects/core/rake_router.rb', line 135

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

Instance Method Details

#generate_path(options) ⇒ Object



144
145
146
147
# File 'lib/ae_page_objects/core/rake_router.rb', line 144

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

#matches?(url) ⇒ Boolean

Returns:

  • (Boolean)


140
141
142
# File 'lib/ae_page_objects/core/rake_router.rb', line 140

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