Class: Nucleo::Models::Element
- Inherits:
-
Object
- Object
- Nucleo::Models::Element
- Includes:
- Comparable
- Defined in:
- lib/nucleo/models/element.rb
Instance Method Summary collapse
- #alt ⇒ Object
- #content ⇒ Object
- #content_empty? ⇒ Boolean
- #content_length ⇒ Object
- #content_present? ⇒ Boolean
- #html ⇒ Object
-
#initialize(attributes = {}) ⇒ Element
constructor
A new instance of Element.
- #src ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Element
Returns a new instance of Element.
6 7 8 |
# File 'lib/nucleo/models/element.rb', line 6 def initialize(attributes={}) @attributes = attributes end |
Instance Method Details
#alt ⇒ Object
18 19 20 |
# File 'lib/nucleo/models/element.rb', line 18 def alt @attributes.fetch('alt', '') end |
#content ⇒ Object
10 11 12 |
# File 'lib/nucleo/models/element.rb', line 10 def content @attributes.fetch('content', '') end |
#content_empty? ⇒ Boolean
26 27 28 |
# File 'lib/nucleo/models/element.rb', line 26 def content_empty? self.content.empty? end |
#content_length ⇒ Object
22 23 24 |
# File 'lib/nucleo/models/element.rb', line 22 def content_length self.content.length end |
#content_present? ⇒ Boolean
30 31 32 |
# File 'lib/nucleo/models/element.rb', line 30 def content_present? self.content.present? end |
#html ⇒ Object
34 35 36 |
# File 'lib/nucleo/models/element.rb', line 34 def html @attributes.fetch('html', '') end |
#src ⇒ Object
14 15 16 |
# File 'lib/nucleo/models/element.rb', line 14 def src @attributes.fetch('src', '') end |