Class: Trample::Page

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_method, url, parameters = {}) ⇒ Page

Returns a new instance of Page.



5
6
7
8
9
# File 'lib/trample/page.rb', line 5

def initialize(request_method, url, parameters = {})
  @request_method = request_method
  @url            = url
  @parameters     = parameters
end

Instance Attribute Details

#request_methodObject (readonly)

Returns the value of attribute request_method.



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

def request_method
  @request_method
end

Instance Method Details

#==(other) ⇒ Object



15
16
17
18
19
# File 'lib/trample/page.rb', line 15

def ==(other)
  other.is_a?(Page) && 
    other.request_method == request_method &&
      other.url == url
end

#parametersObject



11
12
13
# File 'lib/trample/page.rb', line 11

def parameters
  proc_params? ? @parameters.call : @parameters
end

#urlObject



21
22
23
# File 'lib/trample/page.rb', line 21

def url
  proc_params? ? interpolated_url : @url
end