Class: PUNK::Runnable

Inherits:
Settings
  • Object
show all
Includes:
Validatable
Defined in:
lib/punk/framework/runnable.rb

Direct Known Subclasses

Service, Worker

Instance Attribute Summary

Attributes included from Validatable

#errors

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Validatable

#default_validation_helpers_options, #get_column_value, #valid?, #validate, #validates_not_empty

Methods included from Plugins::Validation::InstanceMethods

#validates_email, #validates_event, #validates_phone, #validates_state, #validates_url

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(key, *args, &block) ⇒ Object



13
14
15
16
17
# File 'lib/punk/framework/runnable.rb', line 13

def method_missing(key, *args, &block)
  val = super
  val = val.to_h if val.instance_of?(self.class)
  val
end

Class Method Details

.args(*args) ⇒ Object



7
8
9
10
11
# File 'lib/punk/framework/runnable.rb', line 7

def self.args(*args)
  PUNK.store.runnable ||= {}
  return PUNK.store.runnable[name] if PUNK.store.runnable.key?(name)
  PUNK.store.runnable[name] = args
end

Instance Method Details

#respond_to_missing?(key, *args) ⇒ Boolean

rubocop:disable Lint/UselessMethodDefinition

Returns:

  • (Boolean)


19
20
21
# File 'lib/punk/framework/runnable.rb', line 19

def respond_to_missing?(key, *args) # rubocop:disable Lint/UselessMethodDefinition
  super
end