Class: Textus::Step::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/textus/step/base.rb

Direct Known Subclasses

Fetch, Observe, Transform, Validate

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#nameObject

Assigned by the loader/registry at registration time.



32
33
34
# File 'lib/textus/step/base.rb', line 32

def name
  @name
end

Class Method Details

.kindObject

The step kind is derived from class hierarchy.

Raises:

  • (NotImplementedError)


8
9
10
11
12
13
14
15
# File 'lib/textus/step/base.rb', line 8

def kind
  return :fetch if defined?(Step::Fetch) && self <= Step::Fetch
  return :transform if defined?(Step::Transform) && self <= Step::Transform
  return :validate if defined?(Step::Validate) && self <= Step::Validate
  return :observe if defined?(Step::Observe) && self <= Step::Observe

  raise NotImplementedError.new("#{self} is not a known step kind")
end

.required_kwargsObject

Required #call kwargs the loader validates against the subclass.



18
# File 'lib/textus/step/base.rb', line 18

def required_kwargs = []

.step_name(value = :__read__) ⇒ Object

Built-ins (and only built-ins) override the registered name when the Ruby class name can’t carry it (e.g. “markdown-links”).



22
23
24
25
26
27
28
# File 'lib/textus/step/base.rb', line 22

def step_name(value = :__read__)
  if value == :__read__
    @step_name
  else
    @step_name = value.to_s
  end
end