Class: Parsable::Remote

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Remote

Returns a new instance of Remote.



10
11
12
# File 'lib/parsable/remote.rb', line 10

def initialize options={}
  self.secure = options.fetch(:secure, false)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_sym, *arguments, &block) ⇒ Object



14
15
16
17
18
# File 'lib/parsable/remote.rb', line 14

def method_missing(method_sym, *arguments, &block)
  if uri = uri?(method_sym)
    get_response(uri)
  end
end

Instance Attribute Details

#secureObject

uses the response from a remote location



8
9
10
# File 'lib/parsable/remote.rb', line 8

def secure
  @secure
end