Class: Foobara::Generators::TypeGenerator::TypeConfig

Inherits:
Model
  • Object
show all
Defined in:
foobara-type-generator-0.0.4/src/type_config.rb

Defined Under Namespace

Classes: TypeType

Constant Summary

Constants inherited from Model

Model::ALLOWED_OPTIONS

Instance Attribute Summary

Attributes inherited from Model

#mutable, #skip_validations

Instance Method Summary collapse

Methods inherited from Model

#==, abstract, abstract?, attribute_names, #attributes, #attributes_with_delegates, #cast_attribute, #cast_attribute!, closest_namespace_module, description, domain, domain_name, #eql?, foobara_model_name, foobara_name, full_model_name, #hash, #initialize, install!, organization_name, possible_errors, #read_attribute, #read_attribute!, reset_all, subclass, #to_h, #to_json, #valid?, valid_attribute_name?, #validate!, validate_attribute_name!, #validation_errors, #write_attribute, #write_attribute!, #write_attributes, #write_attributes!

Methods included from Concern

foobara_class_methods_module_for, foobara_concern?, included

Constructor Details

This class inherits a constructor from Foobara::Model

Instance Method Details

#domain_pathObject

[View source]

25
26
27
# File 'foobara-type-generator-0.0.4/src/type_config.rb', line 25

def domain_path
  @domain_path ||= [*organization&.split("::"), *domain&.split("::")]
end

#has_domain?Boolean

Returns:

  • (Boolean)
[View source]

33
34
35
# File 'foobara-type-generator-0.0.4/src/type_config.rb', line 33

def has_domain?
  !domain_path.empty?
end

#module_pathObject

[View source]

21
22
23
# File 'foobara-type-generator-0.0.4/src/type_config.rb', line 21

def module_path
  @module_path ||= domain_path + post_domain_path
end

#post_domain_pathObject

[View source]

29
30
31
# File 'foobara-type-generator-0.0.4/src/type_config.rb', line 29

def post_domain_path
  name.split("::")
end