Class: Noodall::Site

Inherits:
Object show all
Defined in:
lib/noodall/site.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.mapObject

Returns the value of attribute map.



5
6
7
# File 'lib/noodall/site.rb', line 5

def map
  @map
end

Returns the value of attribute permalinks.



5
6
7
# File 'lib/noodall/site.rb', line 5

def permalinks
  @permalinks
end

Class Method Details

.build!Object



7
8
9
10
11
12
# File 'lib/noodall/site.rb', line 7

def build!
  return false unless map.is_a?(Hash)
  map.each do |permalink, attributes|
    build_node(permalink, attributes)
  end
end

.contains?(permalink) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
17
18
19
20
21
22
# File 'lib/noodall/site.rb', line 14

def contains?(permalink)
  self.permalinks ||= []
  return false unless map.is_a?(Hash)
  return true if map.keys.include?(permalink)
  map.values.each do |attrubutes|
    extract_permalinks(attrubutes)
  end
  return permalinks.include?(permalink)
end