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)


37
38
39
40
41
# File 'lib/convenient_service/feature/plugins/can_have_entries/commands/define_entries.rb', line 37

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.



30
31
32
# File 'lib/convenient_service/feature/plugins/can_have_entries/commands/define_entries.rb', line 30

def body
  @body
end

#feature_classObject (readonly)

Returns the value of attribute feature_class.



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

def feature_class
  @feature_class
end

#namesObject (readonly)

Returns the value of attribute names.



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

def names
  @names
end

Instance Method Details

#callArray<String, Symbol>

Returns:

  • (Array<String, Symbol>)


46
47
48
# File 'lib/convenient_service/feature/plugins/can_have_entries/commands/define_entries.rb', line 46

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