Class: WunderMarkdown::List

Inherits:
Struct
  • Object
show all
Defined in:
lib/wunder_markdown/list.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#clientObject

Returns the value of attribute client.



3
4
5
# File 'lib/wunder_markdown/list.rb', line 3

def client
  @client
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



2
3
4
# File 'lib/wunder_markdown/list.rb', line 2

def id
  @id
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



2
3
4
# File 'lib/wunder_markdown/list.rb', line 2

def name
  @name
end

#tasksObject

Returns the value of attribute tasks.



3
4
5
# File 'lib/wunder_markdown/list.rb', line 3

def tasks
  @tasks
end

Instance Method Details

#to_markdownObject



5
6
7
8
9
10
11
# File 'lib/wunder_markdown/list.rb', line 5

def to_markdown
  markdown = "# #{name}  \n  \n"
  if tasks
    markdown += tasks.map(&:to_markdown).join("  \n")
  end
  markdown
end