Class: WeatherForecasts::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/weather_forecasts/client.rb,
lib/weather_forecasts/client/error.rb,
lib/weather_forecasts/client/query.rb,
lib/weather_forecasts/client/version.rb,
lib/weather_forecasts/client/help_console.rb,
lib/weather_forecasts/client/query/select_query.rb,
lib/weather_forecasts/client/query/query_property.rb,
lib/weather_forecasts/client/query/query_utilities.rb,
lib/weather_forecasts/client/query/select_hourly_query.rb,
lib/weather_forecasts/client/query/select_by_days_query.rb,
lib/weather_forecasts/client/query/selection_attributes.rb,
lib/weather_forecasts/client/query/select_coordinates_by_zip_query.rb,
lib/weather_forecasts/client/query/select_corner_coordinates_query.rb,
lib/weather_forecasts/client/query/select_square_coordinates_query.rb,
lib/weather_forecasts/client/query/select_coordinates_by_cities_query.rb,
lib/weather_forecasts/client/query/select_gridpoint_coordinates_query.rb,
lib/weather_forecasts/client/query/select_linepoint_coordinates_query.rb

Defined Under Namespace

Modules: QueryUtilities Classes: HelpConsole, InvalidOptionSpecifiedError, InvalidPropertyTypeError, InvalidSelectionAttributeError, Query, QueryProperty, RequiredKeysMissingError, RequiredPropertyError, SelectByDaysQuery, SelectCoordinatesByCitiesQuery, SelectCoordinatesByZipQuery, SelectCornerCoordinatesQuery, SelectGridpointCoordinatesQuery, SelectHourlyQuery, SelectLinepointCoordinatesQuery, SelectQuery, SelectSquareCoordinatesQuery, SelectionAttributes

Constant Summary collapse

DEFAULT_WSDL =
"http://graphical.weather.gov/xml/DWMLgen/wsdl/ndfdXML.wsdl"
VERSION =
"1.2.7"

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/weather_forecasts/client.rb', line 13

def initialize(options = {})
  @options = options

  if options[:wsdl].blank?
    @options.merge!(:wsdl => DEFAULT_WSDL)
  end

  if options[:logger].present?
    HttpLogger.logger = options[:logger]
  end
end

Instance Method Details

#select(*options) ⇒ Object

Query Methods



33
34
35
# File 'lib/weather_forecasts/client.rb', line 33

def select(*options)
  SelectQuery.new(soap_client, options)
end

#select_by_daysObject



41
42
43
# File 'lib/weather_forecasts/client.rb', line 41

def select_by_days
  SelectByDaysQuery.new(soap_client)
end

#select_coordinates_by_citiesObject



49
50
51
# File 'lib/weather_forecasts/client.rb', line 49

def select_coordinates_by_cities
  SelectCoordinatesByCitiesQuery.new(soap_client)
end

#select_coordinates_by_zipObject



45
46
47
# File 'lib/weather_forecasts/client.rb', line 45

def select_coordinates_by_zip
  SelectCoordinatesByZipQuery.new(soap_client)
end

#select_corner_coordinatesObject



65
66
67
# File 'lib/weather_forecasts/client.rb', line 65

def select_corner_coordinates
  SelectCornerCoordinatesQuery.new(soap_client)
end

#select_gridpoint_coordinatesObject



57
58
59
# File 'lib/weather_forecasts/client.rb', line 57

def select_gridpoint_coordinates
  SelectGridpointCoordinatesQuery.new(soap_client)
end

#select_hourlyObject



37
38
39
# File 'lib/weather_forecasts/client.rb', line 37

def select_hourly
  SelectHourlyQuery.new(nil)
end

#select_linepoint_coordinatesObject



61
62
63
# File 'lib/weather_forecasts/client.rb', line 61

def select_linepoint_coordinates
  SelectLinepointCoordinatesQuery.new(soap_client)
end

#select_square_coordinatesObject



53
54
55
# File 'lib/weather_forecasts/client.rb', line 53

def select_square_coordinates
  SelectSquareCoordinatesQuery.new(soap_client)
end

#soap_clientObject



25
26
27
# File 'lib/weather_forecasts/client.rb', line 25

def soap_client
  @soap_client ||= Savon.client(@options)
end