module Safrano::ServiceBase::Transitions

methods related to transitions to next state (cf. walker)

Constants

ALLOWED_TRANSITIONS_FIXED
DOLLAR_ID_REGEXP

Public Instance Methods

allowed_transitions() click to toggle source
# File lib/safrano/service.rb, line 600
def allowed_transitions
  @allowed_transitions
end
build_allowed_transitions() click to toggle source
# File lib/safrano/service.rb, line 584
def build_allowed_transitions
  @allowed_transitions = if @function_imports.empty?
                           (ALLOWED_TRANSITIONS_FIXED + [
                             Safrano::Transition.new(%r{\A/(#{base_url_regexp})(.*)},
                                                     trans: 'transition_collection')
                           ]).freeze
                         else
                           (ALLOWED_TRANSITIONS_FIXED + [
                             Safrano::Transition.new(%r{\A/(#{base_url_regexp})(.*)},
                                                     trans: 'transition_collection'),
                             Safrano::Transition.new(%r{\A/(#{base_url_func_regexp})(.*)},
                                                     trans: 'transition_service_op')
                           ]).freeze
                         end
end
thread_safe_collection(collklass) click to toggle source
# File lib/safrano/service.rb, line 604
def thread_safe_collection(collklass)
  Safrano::OData::Collection.new(collklass)
end
transition_batch(_match_result) click to toggle source
# File lib/safrano/service.rb, line 617
def transition_batch(_match_result)
  [@batch_handler, :run]
end
transition_collection(match_result) click to toggle source
# File lib/safrano/service.rb, line 608
def transition_collection(match_result)
  [thread_safe_collection(@cmap[match_result[1]]), :run] if match_result[1]
  #        [@cmap[match_result[1]], :run] if match_result[1]
end
transition_content_id(match_result) click to toggle source
# File lib/safrano/service.rb, line 621
def transition_content_id(match_result)
  [match_result[2], :run_with_content_id]
end
transition_end(_match_result) click to toggle source
# File lib/safrano/service.rb, line 629
def transition_end(_match_result)
  Safrano::Transition::RESULT_END
end
transition_metadata(_match_result) click to toggle source
# File lib/safrano/service.rb, line 625
def transition_metadata(_match_result)
  [@meta, :run]
end
transition_service_op(match_result) click to toggle source
# File lib/safrano/service.rb, line 613
def transition_service_op(match_result)
  [@function_imports[match_result[1]], :run] if match_result[1]
end