Class: MD::Page::Element
- Inherits:
-
Object
- Object
- MD::Page::Element
- Defined in:
- lib/md2slides/md.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(type, value, attributes) ⇒ Element
constructor
A new instance of Element.
- #to_s ⇒ Object
Constructor Details
#initialize(type, value, attributes) ⇒ Element
7 8 9 |
# File 'lib/md2slides/md.rb', line 7 def initialize(type, value, attributes) @type, @value, @attributes = type, value, attributes end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
6 7 8 |
# File 'lib/md2slides/md.rb', line 6 def attributes @attributes end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/md2slides/md.rb', line 6 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
6 7 8 |
# File 'lib/md2slides/md.rb', line 6 def value @value end |
Instance Method Details
#to_s ⇒ Object
11 12 13 |
# File 'lib/md2slides/md.rb', line 11 def to_s "#{@type.to_s}: #{@value} (#{@attributes.map { |k, v| "#{k}: #{v}"}.join(",")})" end |