Class: Atreides::ContentPart
- Includes:
- Base::Validation, Extendable
- Defined in:
- app/models/atreides/content_part.rb
Constant Summary collapse
- @@content_types =
Constants
%w(text photos videos)
- @@display_types =
%w(photos gallery)
Class Method Summary collapse
Instance Method Summary collapse
-
#content_type ⇒ Object
Instance Methods.
- #content_types ⇒ Object
- #display_type ⇒ Object
Methods included from Base::Validation
Methods inherited from Base
Class Method Details
.base_class ⇒ Object
61 62 63 |
# File 'app/models/atreides/content_part.rb', line 61 def base_class self end |
.content_types ⇒ Object
53 54 55 |
# File 'app/models/atreides/content_part.rb', line 53 def content_types @@content_types end |
.display_types ⇒ Object
57 58 59 |
# File 'app/models/atreides/content_part.rb', line 57 def display_types @@display_types end |
Instance Method Details
#content_type ⇒ Object
Instance Methods
70 71 72 |
# File 'app/models/atreides/content_part.rb', line 70 def content_type @_content_type ||= ActiveSupport::StringInquirer.new(read_attribute(:content_type)) unless read_attribute(:content_type).blank? end |
#content_types ⇒ Object
78 79 80 |
# File 'app/models/atreides/content_part.rb', line 78 def content_types self.class.content_types end |
#display_type ⇒ Object
74 75 76 |
# File 'app/models/atreides/content_part.rb', line 74 def display_type @_display_type ||= ActiveSupport::StringInquirer.new(read_attribute(:display_type)) unless read_attribute(:display_type).blank? end |