Sha256: 22eb92b5932cd0a08061d2a3641ce28f5104923f234e166219a1f2d136243ee0

Contents?: true

Size: 1.27 KB

Versions: 1

Compression:

Stored size: 1.27 KB

Contents

module FlowNodePatron
  module FlowPromisedLandPatronOperation
    def checkin
      logger.info 'checkin ... '
      FlowPromisedLandRest.post '/org_patrons/checkin',
                                org_patron_token: ::FlowNodePatron::Config::PROMISED_LAND_ORG_PATRON_TOKEN,
                                version: ::FlowNodePatron::Config::PATRON_VERSION
    end

    def logout
      logger.info 'logout ...'
      FlowPromisedLandRest.post "/org_patrons/#{::FlowNodePatron::Config::PROMISED_LAND_ORG_PATRON_TOKEN}/logout", {}
    end

    def update_report(patron_running_status, service_box_id = nil)
      logger.info "report patron_running_status #{patron_running_status} run box #{service_box_id}"
      FlowPromisedLandRest.post "/org_patrons/#{::FlowNodePatron::Config::PROMISED_LAND_ORG_PATRON_TOKEN}/update_report",
                                patron_running_status: patron_running_status,
                                service_box_id:       service_box_id
    end

    def show
      FlowPromisedLandRest.get "/org_patrons/#{::FlowNodePatron::Config::PROMISED_LAND_ORG_PATRON_TOKEN}"
    end

    alias show_patron_info show

    # DEBUG USE
    def list
      FlowPromisedLandRest.get '/org_patrons'
    end

    private

    def logger
      FlowNodePatron.logger
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flow_org_patron-0.1.1 lib/flow_node_patron/operations/flow_promised_land_patron_operation.rb