Class: HecksDomain::Generators::Entity

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Entity

Returns a new instance of Entity.



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

def initialize(args)
  @domain = args[0]
  @aggregate = args[1]
  @domain_object = args[2]

  @domain_name = @domain.name.to_s.underscore
  @aggregate_name = @aggregate.name.to_s.underscore
  @domain_object_name = @domain_object.name.to_s.underscore
  super
end

Instance Attribute Details

#aggregateObject (readonly)

Returns the value of attribute aggregate.



6
7
8
# File 'lib/hecks/domain/generators/entity.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/entity.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/entity.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/entity.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/entity.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/entity.rb', line 6

def domain_object_name
  @domain_object_name
end

Class Method Details

.source_rootObject



21
22
23
# File 'lib/hecks/domain/generators/entity.rb', line 21

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

Instance Method Details

#write_aggregate_directoryObject



25
26
27
# File 'lib/hecks/domain/generators/entity.rb', line 25

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