Class: ActiveadminSelleoCms::Layout::Section
- Inherits:
-
Object
- Object
- ActiveadminSelleoCms::Layout::Section
- Defined in:
- app/models/activeadmin_selleo_cms/layout.rb
Instance Attribute Summary collapse
-
#cover_height ⇒ Object
Returns the value of attribute cover_height.
-
#cover_resize_method ⇒ Object
Returns the value of attribute cover_resize_method.
-
#cover_width ⇒ Object
Returns the value of attribute cover_width.
-
#height ⇒ Object
Returns the value of attribute height.
-
#name ⇒ Object
Returns the value of attribute name.
-
#resize_method ⇒ Object
Returns the value of attribute resize_method.
-
#toolbar ⇒ Object
Returns the value of attribute toolbar.
-
#type ⇒ Object
Returns the value of attribute type.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
- #attachment? ⇒ Boolean
- #attachments? ⇒ Boolean
- #image? ⇒ Boolean
- #images? ⇒ Boolean
-
#initialize(node) ⇒ Section
constructor
A new instance of Section.
- #related? ⇒ Boolean
- #text? ⇒ Boolean
Constructor Details
#initialize(node) ⇒ Section
Returns a new instance of Section.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'app/models/activeadmin_selleo_cms/layout.rb', line 42 def initialize(node) @name = node.attributes["name"].content @type = node.attributes["data-type"] ? node.attributes["data-type"].content : 'ckeditor' @attachments = node.attributes["data-attachments"].present? @attachment = node.attributes["data-attachment"].present? @related = node.attributes["data-related"].present? @toolbar = node.attributes["data-toolbar"] ? node.attributes["data-toolbar"].content : 'Minimal' @width = node.attributes["data-width"] ? node.attributes["data-width"].content : 640 @height = node.attributes["data-height"] ? node.attributes["data-height"].content : 480 @resize_method = node.attributes["data-resize-method"] ? node.attributes["data-resize-method"].content : "#" @cover_width = node.attributes["data-cover-width"] ? node.attributes["data-cover-width"].content : 140 @cover_height = node.attributes["data-cover-height"] ? node.attributes["data-cover-height"].content : 199 @cover_resize_method = node.attributes["data-cover-resize-method"] ? node.attributes["data-cover-resize-method"].content : ">" end |
Instance Attribute Details
#cover_height ⇒ Object
Returns the value of attribute cover_height.
40 41 42 |
# File 'app/models/activeadmin_selleo_cms/layout.rb', line 40 def cover_height @cover_height end |
#cover_resize_method ⇒ Object
Returns the value of attribute cover_resize_method.
40 41 42 |
# File 'app/models/activeadmin_selleo_cms/layout.rb', line 40 def cover_resize_method @cover_resize_method end |
#cover_width ⇒ Object
Returns the value of attribute cover_width.
40 41 42 |
# File 'app/models/activeadmin_selleo_cms/layout.rb', line 40 def cover_width @cover_width end |
#height ⇒ Object
Returns the value of attribute height.
40 41 42 |
# File 'app/models/activeadmin_selleo_cms/layout.rb', line 40 def height @height end |
#name ⇒ Object
Returns the value of attribute name.
40 41 42 |
# File 'app/models/activeadmin_selleo_cms/layout.rb', line 40 def name @name end |
#resize_method ⇒ Object
Returns the value of attribute resize_method.
40 41 42 |
# File 'app/models/activeadmin_selleo_cms/layout.rb', line 40 def resize_method @resize_method end |
#toolbar ⇒ Object
Returns the value of attribute toolbar.
40 41 42 |
# File 'app/models/activeadmin_selleo_cms/layout.rb', line 40 def @toolbar end |
#type ⇒ Object
Returns the value of attribute type.
40 41 42 |
# File 'app/models/activeadmin_selleo_cms/layout.rb', line 40 def type @type end |
#width ⇒ Object
Returns the value of attribute width.
40 41 42 |
# File 'app/models/activeadmin_selleo_cms/layout.rb', line 40 def width @width end |
Instance Method Details
#attachment? ⇒ Boolean
73 74 75 |
# File 'app/models/activeadmin_selleo_cms/layout.rb', line 73 def ['file'].include?(@type.downcase) or @attachment end |
#attachments? ⇒ Boolean
69 70 71 |
# File 'app/models/activeadmin_selleo_cms/layout.rb', line 69 def ['files'].include?(@type.downcase) or @attachments end |
#image? ⇒ Boolean
61 62 63 |
# File 'app/models/activeadmin_selleo_cms/layout.rb', line 61 def image? ['image'].include? @type.downcase end |
#images? ⇒ Boolean
65 66 67 |
# File 'app/models/activeadmin_selleo_cms/layout.rb', line 65 def images? ['images'].include? @type.downcase end |
#related? ⇒ Boolean
77 78 79 |
# File 'app/models/activeadmin_selleo_cms/layout.rb', line 77 def ['related'].include?(@type.downcase) or @related end |
#text? ⇒ Boolean
57 58 59 |
# File 'app/models/activeadmin_selleo_cms/layout.rb', line 57 def text? ['ckeditor', 'text', 'string'].include? @type.downcase end |