lib/simple/service/action.rb in simple-service-0.1.3 vs lib/simple/service/action.rb in simple-service-0.1.4

- old
+ new

@@ -13,15 +13,15 @@ # rubocop:disable Metrics/CyclomaticComplexity # rubocop:disable Style/GuardClause # rubocop:disable Metrics/ClassLength class Action - IDENTIFIER_PATTERN = "[a-z][a-z0-9_]*" # :nodoc: - IDENTIFIER_REGEXP = Regexp.compile("\\A#{IDENTIFIER_PATTERN}\\z") # :nodoc: + IDENTIFIER_PATTERN = "[a-z][a-z0-9_]*" # @private + IDENTIFIER_REGEXP = Regexp.compile("\\A#{IDENTIFIER_PATTERN}\\z") # @private # determines all services provided by the +service+ service module. - def self.enumerate(service:) # :nodoc: + def self.enumerate(service:) # @private service.public_instance_methods(false) .grep(IDENTIFIER_REGEXP) .each_with_object({}) { |name, hsh| hsh[name] = Action.new(service, name) } end @@ -30,20 +30,20 @@ def full_name "#{service.name}##{name}" end - def to_s # :nodoc: + def to_s # @private full_name end # returns an Array of Parameter structures. def parameters @parameters ||= Parameter.reflect_on_method(service: service, name: name) end - def initialize(service, name) # :nodoc: + def initialize(service, name) # @private @service = service @name = name parameters end @@ -114,10 +114,10 @@ end private # returns an error if the keywords hash does not define all required keyword arguments. - def verify_required_args!(args, flags) # :nodoc: + def verify_required_args!(args, flags) # @private @required_names ||= parameters.select(&:required?).map(&:name).map(&:to_s) missing_parameters = @required_names - args.keys - flags.keys return if missing_parameters.empty?