Module: ConvenientService::Service::Configs::Standard

Includes:
Config, ConvenientService::Service::Core
Included in:
Examples::Standard::Cowsay::Services::BuildCloud, Examples::Standard::Cowsay::Services::BuildCow, Examples::Standard::Cowsay::Services::Print, Examples::Standard::DateTime::Services::SafeParse, Examples::Standard::Factorial::Services::Calculate, Examples::Standard::Gemfile::Services::AssertFileExists, Examples::Standard::Gemfile::Services::AssertFileNotEmpty, Examples::Standard::Gemfile::Services::AssertNodeAvailable, Examples::Standard::Gemfile::Services::AssertNpmPackageAvailable, Examples::Standard::Gemfile::Services::AssertValidRubySyntax, Examples::Standard::Gemfile::Services::Format, Examples::Standard::Gemfile::Services::FormatBody, Examples::Standard::Gemfile::Services::FormatGemsWithEnvs, Examples::Standard::Gemfile::Services::FormatGemsWithoutEnvs, Examples::Standard::Gemfile::Services::FormatHeader, Examples::Standard::Gemfile::Services::MergeSections, Examples::Standard::Gemfile::Services::ParseContent, Examples::Standard::Gemfile::Services::PrintShellCommand, Examples::Standard::Gemfile::Services::ReadFileContent, Examples::Standard::Gemfile::Services::ReplaceFileContent, Examples::Standard::Gemfile::Services::RunShellCommand, Examples::Standard::Gemfile::Services::StripComments, Examples::Standard::RequestParams::Services::ApplyDefaultParamValues, Examples::Standard::RequestParams::Services::CastParams, Examples::Standard::RequestParams::Services::ExtractParamsFromBody, Examples::Standard::RequestParams::Services::ExtractParamsFromPath, Examples::Standard::RequestParams::Services::FilterOutUnpermittedParams, Examples::Standard::RequestParams::Services::LogRequestParams, Examples::Standard::RequestParams::Services::MergeParams, Examples::Standard::RequestParams::Services::Prepare, Examples::Standard::RequestParams::Services::ValidateCastedParams, Examples::Standard::RequestParams::Services::ValidateUncastedParams
Defined in:
lib/convenient_service/service/configs/standard.rb,
lib/convenient_service/service/configs/standard/v1.rb,
lib/convenient_service/service/configs/standard/commands/is_service.rb,
lib/convenient_service/service/configs/standard/commands/is_service_class.rb

Overview

Default configuration for the user-defined services.

Defined Under Namespace

Modules: Commands, V1

Class Method Summary collapse

Methods included from Config

included

Class Method Details

.service?(service) ⇒ Boolean

Checks whether an object is a service instance.

Examples:

Simple usage.

class Service
  include ConvenientService::Standard::Config

  def result
    success
  end
end

service = Service.new

ConvenientService::Service::Configs::Standard.service?(service)
# => true

ConvenientService::Service::Configs::Standard.service?(42)
# => false

Parameters:

  • service (Object)

    Can be any type.

Returns:

  • (Boolean)


415
416
417
# File 'lib/convenient_service/service/configs/standard.rb', line 415

def service?(service)
  Commands::IsService[service: service]
end

.service_class?(service_class) ⇒ Boolean

Checks whether a class is a service class.

Examples:

Simple usage.

class Service
  include ConvenientService::Standard::Config

  def result
    success
  end
end

ConvenientService::Service::Configs::Standard.service_class?(Service)
# => true

ConvenientService::Service::Configs::Standard.service_class?(42)
# => false

Parameters:

  • service_class (Object)

    Can be any type.

Returns:

  • (Boolean)


386
387
388
# File 'lib/convenient_service/service/configs/standard.rb', line 386

def service_class?(service_class)
  Commands::IsServiceClass[service_class: service_class]
end