Class: Offliberty::Helpers::Connection
- Inherits:
-
Object
- Object
- Offliberty::Helpers::Connection
- Defined in:
- lib/offliberty/helpers/connection.rb
Instance Attribute Summary collapse
-
#agent ⇒ Object
readonly
Returns the value of attribute agent.
-
#form ⇒ Object
readonly
Returns the value of attribute form.
Instance Method Summary collapse
-
#initialize(song_url) ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize(song_url) ⇒ Connection
Returns a new instance of Connection.
6 7 8 9 10 11 12 13 |
# File 'lib/offliberty/helpers/connection.rb', line 6 def initialize song_url @agent = Mechanize.new @agent.user_agent_alias = 'Mac Safari' @page = @agent.get("http://offliberty.com") @form = @page.forms.fetch(0) @form.action = "http://offliberty.com/off03.php" @form.track = song_url end |
Instance Attribute Details
#agent ⇒ Object (readonly)
Returns the value of attribute agent.
4 5 6 |
# File 'lib/offliberty/helpers/connection.rb', line 4 def agent @agent end |
#form ⇒ Object (readonly)
Returns the value of attribute form.
4 5 6 |
# File 'lib/offliberty/helpers/connection.rb', line 4 def form @form end |