Class: KDomain::DomainModel::RailsModel
- Inherits:
-
Object
- Object
- KDomain::DomainModel::RailsModel
- Defined in:
- lib/k_domain/schemas/domain/old/rails_model.rb
Overview
Rails model represents information that is found the model.rb class in the rails project
Instance Attribute Summary collapse
-
#default_scope ⇒ Object
Returns the value of attribute default_scope.
-
#documentation_rel_path ⇒ Object
Returns the value of attribute documentation_rel_path.
-
#force ⇒ Object
Returns the value of attribute force.
- #id ⇒ Object
-
#model_path ⇒ Object
Returns the value of attribute model_path.
-
#name ⇒ Object
Returns the value of attribute name.
-
#name_original ⇒ Object
Returns the value of attribute name_original.
-
#name_plural ⇒ Object
Returns the value of attribute name_plural.
-
#primary_key ⇒ Object
Returns the value of attribute primary_key.
-
#private_instance_methods ⇒ Object
Returns the value of attribute private_instance_methods.
-
#public_class_methods ⇒ Object
Returns the value of attribute public_class_methods.
-
#public_instance_methods ⇒ Object
Returns the value of attribute public_instance_methods.
-
#quirks ⇒ Object
Returns the value of attribute quirks.
-
#ruby_code ⇒ Object
Returns the value of attribute ruby_code.
-
#ruby_code_private ⇒ Object
Returns the value of attribute ruby_code_private.
-
#ruby_code_public ⇒ Object
Returns the value of attribute ruby_code_public.
-
#ruby_frozen ⇒ Object
Returns the value of attribute ruby_frozen.
-
#ruby_header ⇒ Object
Returns the value of attribute ruby_header.
-
#ruby_raw ⇒ Object
Returns the value of attribute ruby_raw.
-
#scopes ⇒ Object
Returns the value of attribute scopes.
-
#time_stamp1 ⇒ Object
stats.
-
#time_stamp2 ⇒ Object
Returns the value of attribute time_stamp2.
-
#time_stamp3 ⇒ Object
Returns the value of attribute time_stamp3.
Instance Method Summary collapse
- #add_quirk(quirk) ⇒ Object
- #code_length ⇒ Object
- #display_quirks ⇒ Object
- #exists? ⇒ Boolean
-
#initialize ⇒ RailsModel
constructor
A new instance of RailsModel.
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ RailsModel
Returns a new instance of RailsModel.
53 54 55 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 53 def initialize @quirks = [] end |
Instance Attribute Details
#default_scope ⇒ Object
Returns the value of attribute default_scope.
30 31 32 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 30 def default_scope @default_scope end |
#documentation_rel_path ⇒ Object
Returns the value of attribute documentation_rel_path.
10 11 12 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 10 def documentation_rel_path @documentation_rel_path end |
#force ⇒ Object
Returns the value of attribute force.
19 20 21 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 19 def force @force end |
#id ⇒ Object
17 18 19 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 17 def id @id end |
#model_path ⇒ Object
Returns the value of attribute model_path.
11 12 13 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 11 def model_path @model_path end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 7 def name @name end |
#name_original ⇒ Object
Returns the value of attribute name_original.
9 10 11 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 9 def name_original @name_original end |
#name_plural ⇒ Object
Returns the value of attribute name_plural.
8 9 10 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 8 def name_plural @name_plural end |
#primary_key ⇒ Object
Returns the value of attribute primary_key.
20 21 22 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 20 def primary_key @primary_key end |
#private_instance_methods ⇒ Object
Returns the value of attribute private_instance_methods.
34 35 36 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 34 def private_instance_methods @private_instance_methods end |
#public_class_methods ⇒ Object
Returns the value of attribute public_class_methods.
32 33 34 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 32 def public_class_methods @public_class_methods end |
#public_instance_methods ⇒ Object
Returns the value of attribute public_instance_methods.
33 34 35 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 33 def public_instance_methods @public_instance_methods end |
#quirks ⇒ Object
Returns the value of attribute quirks.
21 22 23 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 21 def quirks @quirks end |
#ruby_code ⇒ Object
Returns the value of attribute ruby_code.
24 25 26 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 24 def ruby_code @ruby_code end |
#ruby_code_private ⇒ Object
Returns the value of attribute ruby_code_private.
28 29 30 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 28 def ruby_code_private @ruby_code_private end |
#ruby_code_public ⇒ Object
Returns the value of attribute ruby_code_public.
27 28 29 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 27 def ruby_code_public @ruby_code_public end |
#ruby_frozen ⇒ Object
Returns the value of attribute ruby_frozen.
25 26 27 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 25 def ruby_frozen @ruby_frozen end |
#ruby_header ⇒ Object
Returns the value of attribute ruby_header.
26 27 28 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 26 def ruby_header @ruby_header end |
#ruby_raw ⇒ Object
Returns the value of attribute ruby_raw.
23 24 25 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 23 def ruby_raw @ruby_raw end |
#scopes ⇒ Object
Returns the value of attribute scopes.
31 32 33 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 31 def scopes @scopes end |
#time_stamp1 ⇒ Object
stats
37 38 39 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 37 def time_stamp1 @time_stamp1 end |
#time_stamp2 ⇒ Object
Returns the value of attribute time_stamp2.
38 39 40 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 38 def time_stamp2 @time_stamp2 end |
#time_stamp3 ⇒ Object
Returns the value of attribute time_stamp3.
39 40 41 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 39 def time_stamp3 @time_stamp3 end |
Instance Method Details
#add_quirk(quirk) ⇒ Object
57 58 59 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 57 def add_quirk(quirk) @quirks << quirk end |
#code_length ⇒ Object
41 42 43 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 41 def code_length ruby_raw&.length end |
#display_quirks ⇒ Object
45 46 47 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 45 def display_quirks quirks.join(' ') end |
#exists? ⇒ Boolean
49 50 51 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 49 def exists? File.exist?(model_path) end |
#to_h ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/k_domain/schemas/domain/old/rails_model.rb', line 61 def to_h { name: name, name_plural: name_plural, name_original: name_original, documentation_rel_path: documentation_rel_path, model_path: model_path, id: id, force: force, primary_key: primary_key, quirks: quirks, ruby_raw: ruby_raw, ruby_code: ruby_code, ruby_frozen: ruby_frozen, ruby_header: ruby_header, ruby_code_public: ruby_code_public, ruby_code_private: ruby_code_private, default_scope: default_scope, scopes: scopes, public_class_methods: public_class_methods, public_instance_methods: public_instance_methods, private_instance_methods: private_instance_methods, time_stamp1: time_stamp1, time_stamp2: time_stamp2, time_stamp3: time_stamp3, code_length: code_length, exists: exists? } end |