Class: Markio::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/markio/builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Builder

Returns a new instance of Builder.



7
8
9
10
# File 'lib/markio/builder.rb', line 7

def initialize(options = {})
  @title = options[:title] || 'Bookmarks'
  @bookmarks = []
end

Instance Attribute Details

#bookmarksObject

Returns the value of attribute bookmarks.



5
6
7
# File 'lib/markio/builder.rb', line 5

def bookmarks
  @bookmarks
end

Instance Method Details

#build_file(file) ⇒ Object



16
17
18
19
20
# File 'lib/markio/builder.rb', line 16

def build_file(file)
  File.new(file, 'w') do |f|
    f.write build
  end
end

#build_stringObject



12
13
14
# File 'lib/markio/builder.rb', line 12

def build_string
  build
end