Class: ConvenientService::Feature::Plugins::CanHaveEntries::Commands::DefineEntries

Inherits:
Support::Command
  • Object
show all
Defined in:
lib/convenient_service/feature/plugins/can_have_entries/commands/define_entries.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Support::Command

[], call

Constructor Details

#initialize(feature_class:, names:, body:) ⇒ DefineEntries

Returns a new instance of DefineEntries.

Parameters:

  • feature_class (Class)
  • names (Array<String, Symbol>)
  • body (Proc, nil)


32
33
34
35
36
# File 'lib/convenient_service/feature/plugins/can_have_entries/commands/define_entries.rb', line 32

def initialize(feature_class:, names:, body:)
  @feature_class = feature_class
  @names = names
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



25
26
27
# File 'lib/convenient_service/feature/plugins/can_have_entries/commands/define_entries.rb', line 25

def body
  @body
end

#feature_classObject (readonly)

Returns the value of attribute feature_class.



13
14
15
# File 'lib/convenient_service/feature/plugins/can_have_entries/commands/define_entries.rb', line 13

def feature_class
  @feature_class
end

#namesObject (readonly)

Returns the value of attribute names.



19
20
21
# File 'lib/convenient_service/feature/plugins/can_have_entries/commands/define_entries.rb', line 19

def names
  @names
end

Instance Method Details

#callArray<String, Symbol>

Returns:

  • (Array<String, Symbol>)


41
42
43
# File 'lib/convenient_service/feature/plugins/can_have_entries/commands/define_entries.rb', line 41

def call
  names.map { |name| Commands::DefineEntry.call(feature_class: feature_class, name: name, body: body) }
end