Class: CtaTrack::Directions

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

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Directions

Returns a new instance of Directions.

Raises:

  • (ArgumentError)


3
4
5
6
7
8
9
# File 'lib/directions.rb', line 3

def initialize(args)
  raise ArgumentError, "must enter api key" if API.apikey.nil? 
  @result = []
  API.directions(args).root.xpath("dir").each do |node|
    @result << node.text
  end
end

Instance Method Details

#dirObject



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

def dir
  @result
end