Sha256: cac8e7a6733842a1f1c8428e3174be87f78ae9004e47ce2b15b6d4240130564e

Contents?: true

Size: 1.87 KB

Versions: 2

Compression:

Stored size: 1.87 KB

Contents

module GoTransverseTractApi

  module Service

    class ServicePeriod

      class << self

        #
        # @param {Long} eid
        # @param {Hash} options
        #
        def find_by_eid eid, options={}
          return nil unless eid.present?

          params ||= GoTransverseTractApi::ApiData.new.get_query_params({eid: eid}, options)
          GoTransverseTractApi.get_response_for(self, params)
        end

        #
        # @param {Long} service_eid
        # @param {Hash} options
        #
        def find_by_service_eid service_eid, options={}
          return nil unless service_eid.present?

          params ||= GoTransverseTractApi::ApiData.new.get_query_params({service_eid: service_eid}, options)
          GoTransverseTractApi.get_response_for(self, params)
        end

        #
        # @param {Date} start_date
        # @param {Hash} options
        #
        def find_by_start_date start_date, options={}
          return nil unless start_date.present?

          params ||= GoTransverseTractApi::ApiData.new.get_query_params({start_date: start_date}, options)
          GoTransverseTractApi.get_response_for(self, params)
        end

        #
        # @param {Date} end_date
        # @param {Hash} options
        #
        def find_by_end_date end_date, options={}
          return nil unless end_date.present?

          params ||= GoTransverseTractApi::ApiData.new.get_query_params({end_date: end_date}, options)
          GoTransverseTractApi.get_response_for(self, params)
        end

        #
        # @param {Boolean} closed
        # @param {Hash} options
        #
        def find_by_closed closed, options={}
          return nil unless closed.present?

          params ||= GoTransverseTractApi::ApiData.new.get_query_params({closed: closed}, options)
          GoTransverseTractApi.get_response_for(self, params)
        end

      end

    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gotransverse-tract-api-0.8.1 lib/gotransverse-tract-api/service/service_period.rb
gotransverse-tract-api-0.8.0 lib/gotransverse-tract-api/service/service_period.rb