Class: RiderKick::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/rider_kick/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/rider_kick/configuration.rb', line 63

def initialize
  @engine_name   = detect_engine_name
  @domain_scope  = ''
  @use_cases_dir = 'use_cases'
  @entities_dir = 'entities'
  @adapters_dir = 'adapters'
  @repositories_dir = 'repositories'
  @builders_dir = 'builders'
  @utils_dir = 'utils'
  @domains_path  = detect_domains_path
  @entities_path = File.join(@domains_path, @entities_dir)
  @adapters_path = File.join(@domains_path, @adapters_dir)
  @models_path   = detect_models_path
  @template_path = nil
  @type_mapping = DEFAULT_TYPE_MAPPING.dup
  @entity_type_mapping = DEFAULT_ENTITY_TYPE_MAPPING.dup

  @domains_path_overridden = false
  @models_path_overridden = false
end

Instance Attribute Details

#adapters_dirObject

Returns the value of attribute adapters_dir.



61
62
63
# File 'lib/rider_kick/configuration.rb', line 61

def adapters_dir
  @adapters_dir
end

#adapters_pathObject

Returns the value of attribute adapters_path.



61
62
63
# File 'lib/rider_kick/configuration.rb', line 61

def adapters_path
  @adapters_path
end

#builders_dirObject

Returns the value of attribute builders_dir.



61
62
63
# File 'lib/rider_kick/configuration.rb', line 61

def builders_dir
  @builders_dir
end

#domain_scopeObject

Returns the value of attribute domain_scope.



60
61
62
# File 'lib/rider_kick/configuration.rb', line 60

def domain_scope
  @domain_scope
end

#domains_pathObject

Returns the value of attribute domains_path.



60
61
62
# File 'lib/rider_kick/configuration.rb', line 60

def domains_path
  @domains_path
end

#engine_nameObject

Returns the value of attribute engine_name.



60
61
62
# File 'lib/rider_kick/configuration.rb', line 60

def engine_name
  @engine_name
end

#entities_dirObject

Returns the value of attribute entities_dir.



61
62
63
# File 'lib/rider_kick/configuration.rb', line 61

def entities_dir
  @entities_dir
end

#entities_pathObject

Returns the value of attribute entities_path.



61
62
63
# File 'lib/rider_kick/configuration.rb', line 61

def entities_path
  @entities_path
end

#entity_type_mappingObject (readonly)

Returns the value of attribute entity_type_mapping.



86
87
88
# File 'lib/rider_kick/configuration.rb', line 86

def entity_type_mapping
  @entity_type_mapping
end

#models_pathObject

Returns the value of attribute models_path.



60
61
62
# File 'lib/rider_kick/configuration.rb', line 60

def models_path
  @models_path
end

#repositories_dirObject

Returns the value of attribute repositories_dir.



61
62
63
# File 'lib/rider_kick/configuration.rb', line 61

def repositories_dir
  @repositories_dir
end

#template_pathObject

Returns the value of attribute template_path.



60
61
62
# File 'lib/rider_kick/configuration.rb', line 60

def template_path
  @template_path
end

#type_mappingObject (readonly)

Returns the value of attribute type_mapping.



84
85
86
# File 'lib/rider_kick/configuration.rb', line 84

def type_mapping
  @type_mapping
end

#use_cases_dirObject

Returns the value of attribute use_cases_dir.



61
62
63
# File 'lib/rider_kick/configuration.rb', line 61

def use_cases_dir
  @use_cases_dir
end

#utils_dirObject

Returns the value of attribute utils_dir.



61
62
63
# File 'lib/rider_kick/configuration.rb', line 61

def utils_dir
  @utils_dir
end

Instance Method Details

#register_entity_type_mapping(db_type, dry_type) ⇒ Object



92
93
94
# File 'lib/rider_kick/configuration.rb', line 92

def register_entity_type_mapping(db_type, dry_type)
  @entity_type_mapping[db_type.to_s] = dry_type.to_s
end

#register_type_mapping(db_type, dry_type) ⇒ Object



88
89
90
# File 'lib/rider_kick/configuration.rb', line 88

def register_type_mapping(db_type, dry_type)
  @type_mapping[db_type.to_s] = dry_type.to_s
end