Class: Folder

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/bookmarks.rb

Overview

for recursively parsing bookmarks

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json, title = "|") ⇒ Folder

Returns a new instance of Folder.



304
305
306
307
# File 'lib/bookmarks.rb', line 304

def initialize(json, title = "|")
  @title = title.gsub(/[:,'"]/, "-").downcase
  @json = json
end

Instance Attribute Details

#jsonObject (readonly)

Returns the value of attribute json.



303
304
305
# File 'lib/bookmarks.rb', line 303

def json
  @json
end

#titleObject (readonly)

Returns the value of attribute title.



303
304
305
# File 'lib/bookmarks.rb', line 303

def title
  @title
end

Instance Method Details

#eachObject

needed for Enumerable



310
311
312
# File 'lib/bookmarks.rb', line 310

def each
  @json.each
end