Class: HecksDomain::Generators::Operation

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/hecks/domain/generators/operation.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args, options) ⇒ Operation

Returns a new instance of Operation.



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/hecks/domain/generators/operation.rb', line 8

def initialize(args, options)
  @domain = args[0]
  @aggregate = args[1]
  @domain_object = args[2]
  @operation = args[3]

  @domain_name = @domain.name.to_s.underscore
  @aggregate_name = @aggregate.name.to_s.underscore
  @domain_object_name = @domain_object.name.to_s.underscore
  @operation_name = @operation.name.to_s.underscore
  super(args, options)
end

Instance Attribute Details

#aggregateObject (readonly)

Returns the value of attribute aggregate.



6
7
8
# File 'lib/hecks/domain/generators/operation.rb', line 6

def aggregate
  @aggregate
end

#aggregate_nameObject (readonly)

Returns the value of attribute aggregate_name.



6
7
8
# File 'lib/hecks/domain/generators/operation.rb', line 6

def aggregate_name
  @aggregate_name
end

#domainObject (readonly)

Returns the value of attribute domain.



6
7
8
# File 'lib/hecks/domain/generators/operation.rb', line 6

def domain
  @domain
end

#domain_nameObject (readonly)

Returns the value of attribute domain_name.



6
7
8
# File 'lib/hecks/domain/generators/operation.rb', line 6

def domain_name
  @domain_name
end

#domain_objectObject (readonly)

Returns the value of attribute domain_object.



6
7
8
# File 'lib/hecks/domain/generators/operation.rb', line 6

def domain_object
  @domain_object
end

#domain_object_nameObject (readonly)

Returns the value of attribute domain_object_name.



6
7
8
# File 'lib/hecks/domain/generators/operation.rb', line 6

def domain_object_name
  @domain_object_name
end

#operationObject (readonly)

Returns the value of attribute operation.



6
7
8
# File 'lib/hecks/domain/generators/operation.rb', line 6

def operation
  @operation
end

#operation_nameObject (readonly)

Returns the value of attribute operation_name.



6
7
8
# File 'lib/hecks/domain/generators/operation.rb', line 6

def operation_name
  @operation_name
end

Class Method Details

.source_rootObject



23
24
25
# File 'lib/hecks/domain/generators/operation.rb', line 23

def self.source_root
  File.dirname(__FILE__) + '/../templates'
end

Instance Method Details

#write_aggregate_directoryObject



27
28
29
# File 'lib/hecks/domain/generators/operation.rb', line 27

def write_aggregate_directory
  directory('operation', 'domain')
end