Class: LinkBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/link_builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(host) ⇒ LinkBuilder

Returns a new instance of LinkBuilder.



3
4
5
# File 'lib/link_builder.rb', line 3

def initialize(host)
  @host = host
end

Instance Method Details

#edit(id) ⇒ Object



7
8
9
# File 'lib/link_builder.rb', line 7

def edit(id)
  @host + '/pages/editpage.action?pageId=' + id.to_s
end

#view(id, feature = nil, scenario = nil) ⇒ Object



11
12
13
14
15
# File 'lib/link_builder.rb', line 11

def view(id, feature=nil, scenario=nil)
  link = @host + '/pages/viewpage.action?pageId=' + id.to_s
  link += '#' + feature.anchorize  if feature
  link += '-' + scenario.anchorize if scenario
end