Class: MD::Page::Element

Inherits:
Object
  • Object
show all
Defined in:
lib/md2slides/md.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#attributesObject (readonly)

Returns the value of attribute attributes.



6
7
8
# File 'lib/md2slides/md.rb', line 6

def attributes
  @attributes
end

#typeObject (readonly)

Returns the value of attribute type.



6
7
8
# File 'lib/md2slides/md.rb', line 6

def type
  @type
end

#valueObject (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_sObject



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