Class: RFacebook::Facepricot
Instance Method Summary
collapse
#make_facepricot_chain
Constructor Details
Returns a new instance of Facepricot.
82
83
84
85
|
# File 'lib/facepricot.rb', line 82
def initialize(xml)
@doc = Hpricot.XML(xml)
@raw_xml = xml
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(methodSymbol, *params) ⇒ Object
87
88
89
90
91
92
93
|
# File 'lib/facepricot.rb', line 87
def method_missing(methodSymbol, *params)
begin
@doc.method(methodSymbol).call(*params) rescue
return make_facepricot_chain(methodSymbol.to_s, @doc.containers[0])
end
end
|
Instance Method Details
#hpricot ⇒ Object
95
96
97
|
# File 'lib/facepricot.rb', line 95
def hpricot
return @doc
end
|
#raw_xml ⇒ Object
103
104
105
|
# File 'lib/facepricot.rb', line 103
def raw_xml
return @raw_xml
end
|
#response ⇒ Object
99
100
101
|
# File 'lib/facepricot.rb', line 99
def response
return FacepricotChain.new(@doc.containers[0])
end
|
#to_s ⇒ Object
107
108
109
|
# File 'lib/facepricot.rb', line 107
def to_s
return @doc.containers[0].inner_html
end
|