Class: ExpoTurbo::Rails::PairedTemplates::Element
- Inherits:
-
Struct
- Object
- Struct
- ExpoTurbo::Rails::PairedTemplates::Element
- Defined in:
- lib/expo_turbo/rails/paired_templates.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#line ⇒ Object
Returns the value of attribute line.
Instance Method Summary collapse
- #id ⇒ Object
-
#label ⇒ Object
What a reader needs to find this element in the file.
- #summary ⇒ Object
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes
126 127 128 |
# File 'lib/expo_turbo/rails/paired_templates.rb', line 126 def attributes @attributes end |
#line ⇒ Object
Returns the value of attribute line
126 127 128 |
# File 'lib/expo_turbo/rails/paired_templates.rb', line 126 def line @line end |
Instance Method Details
#id ⇒ Object
127 128 129 130 |
# File 'lib/expo_turbo/rails/paired_templates.rb', line 127 def id value = attributes["id"] (value.nil? || value.empty?) ? nil : value end |
#label ⇒ Object
What a reader needs to find this element in the file.
133 134 135 136 137 138 |
# File 'lib/expo_turbo/rails/paired_templates.rb', line 133 def label return "##{id}" if id described = attributes.first described ? "the element with #{described.first}=#{described.last.inspect}" : "an element" end |
#summary ⇒ Object
140 141 142 |
# File 'lib/expo_turbo/rails/paired_templates.rb', line 140 def summary attributes.map { |name, value| "#{name}=#{value.inspect}" }.join(" ") end |