Module: INatGet::System::Context Private

Included in:
Data::DSL::Dataset, Data::Parser, Data::Updater
Defined in:
lib/inat-get/sys/context.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.shutdownBoolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


14
15
16
# File 'lib/inat-get/sys/context.rb', line 14

def shutdown= value
  @@context_shutdown = value
end

Class Method Details

.check_shutdown! { ... } ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Check shutdown mode and interrupt execution if needed

If #shutdown? — execute block if given, than exit with Errno::EINTR::Errno code.

Yields:

  • Do something before exit.



35
36
37
38
39
40
# File 'lib/inat-get/sys/context.rb', line 35

def check_shutdown!
  if shutdown?
    yield if block_given?
    exit(Errno::EINTR::Errno)
  end
end

.shutdown?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


25
26
27
28
# File 'lib/inat-get/sys/context.rb', line 25

def shutdown?
  @@context_shutdown ||= false
  !!@@context_shutdown
end

Instance Method Details

#check_shutdown! { ... } ⇒ void (private)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Check shutdown mode and interrupt execution if needed

If #shutdown? — execute block if given, than exit with Errno::EINTR::Errno code.

Yields:

  • Do something before exit.



35
36
37
38
39
40
# File 'lib/inat-get/sys/context.rb', line 35

def check_shutdown!
  if shutdown?
    yield if block_given?
    exit(Errno::EINTR::Errno)
  end
end

#shutdown?Boolean (private)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


25
26
27
28
# File 'lib/inat-get/sys/context.rb', line 25

def shutdown?
  @@context_shutdown ||= false
  !!@@context_shutdown
end