Class: ActiveRecordAnalyzer::Reflector::Simple
- Inherits:
-
Object
- Object
- ActiveRecordAnalyzer::Reflector::Simple
- Defined in:
- lib/active_record_analyzer/reflector/simple.rb
Instance Method Summary collapse
- #attribute_type ⇒ Object
-
#attributes ⇒ Object
This returns attributes which are not foreign keys (ex: :name, but not :company_id).
- #has_attribute?(attribute) ⇒ Boolean
-
#initialize(klass) ⇒ Simple
constructor
A new instance of Simple.
Constructor Details
#initialize(klass) ⇒ Simple
Returns a new instance of Simple.
2 3 4 |
# File 'lib/active_record_analyzer/reflector/simple.rb', line 2 def initialize(klass) @klass = klass end |
Instance Method Details
#attribute_type ⇒ Object
10 11 12 |
# File 'lib/active_record_analyzer/reflector/simple.rb', line 10 def attribute_type @attribute_type ||= ActiveRecordAnalyzer::Attribute::Simple end |
#attributes ⇒ Object
This returns attributes which are not foreign keys (ex: :name, but not :company_id)
16 17 18 |
# File 'lib/active_record_analyzer/reflector/simple.rb', line 16 def attributes attributes_except_foreign_keys end |
#has_attribute?(attribute) ⇒ Boolean
6 7 8 |
# File 'lib/active_record_analyzer/reflector/simple.rb', line 6 def has_attribute?(attribute) attributes.include?(attribute.to_sym) end |