Class: YieldStarClient::Client

Inherits:
Object
  • Object
show all
Includes:
AmenityMethods, FloorPlanMethods, LeaseTermRentMethods, PropertyMethods, RentMethods, UnitMethods
Defined in:
lib/yield_star_client/client.rb

Overview

YieldStarClient::Client is the main object for connecting to the YieldStar AppExchange service. The interface strives to be SOAP-agnostic whenever possible; all inputs and outputs are pure ruby and no knowledge of SOAP is required in order to use the client.

Instance Method Summary collapse

Methods included from LeaseTermRentMethods

#get_lease_term_rent, #get_lease_term_rent_plus, #get_renewal_lease_term_rent

Methods included from Validations

#validate_client_name!, #validate_external_property_id!

Methods included from RentMethods

#get_available_units, #get_rent_summary

Methods included from AmenityMethods

#get_floor_plan_amenities, #get_unit_amenities

Methods included from UnitMethods

#get_unit, #get_units

Methods included from FloorPlanMethods

#get_floor_plan, #get_floor_plans

Methods included from PropertyMethods

#get_properties, #get_property, #get_property_parameters

Constructor Details

#initialize(options = {}) ⇒ Client

Initializes the client. All options are truly optional; if the option is not supplied to this method, then it will be set based on the YieldStarClient configuration.

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :username (String)

    The username for authenticating to the web service.

  • :password (String)

    The password for authenticating to the web service.

  • :client_name (String)

    The YieldStar client name (required for all requests)

  • :endpoint (String)

    The address for connecting to the web service.

  • :namespace (String)

    The XML namespace to use for requests.

  • :debug (true, false)

    true to enable debug logging of SOAP traffic; defaults to false

See Also:

  • YieldStarClient.configure


57
58
59
60
61
# File 'lib/yield_star_client/client.rb', line 57

def initialize(options={})
  self.debug = nil
  self.logger = nil
  options.each { |k,v| self.send("#{k}=", v) if self.respond_to?("#{k}=") }
end

Instance Method Details

#debug=(val) ⇒ Object



30
31
32
33
# File 'lib/yield_star_client/client.rb', line 30

def debug=(val)
  @debug = val
  Savon.log = self.debug?
end

#debug?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/yield_star_client/client.rb', line 35

def debug?
  get_value(:debug).to_s == 'true'
end

#logger=(val) ⇒ Object



39
40
41
42
# File 'lib/yield_star_client/client.rb', line 39

def logger=(val)
  @logger = val
  Savon.logger = self.logger
end