Class: Microby::HEntry

Inherits:
Element show all
Defined in:
lib/microby/h_entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Element

#[]=, #symbolize_class

Constructor Details

#initialize(microformat) ⇒ HEntry

Certainly there is a better way to do this.



7
8
9
10
# File 'lib/microby/h_entry.rb', line 7

def initialize(microformat)
  @categories = {}
  super
end

Instance Attribute Details

#authorObject

Returns the value of attribute author.



4
5
6
# File 'lib/microby/h_entry.rb', line 4

def author
  @author
end

#bookmarkObject

Returns the value of attribute bookmark.



4
5
6
# File 'lib/microby/h_entry.rb', line 4

def bookmark
  @bookmark
end

#categoriesObject

Returns the value of attribute categories.



4
5
6
# File 'lib/microby/h_entry.rb', line 4

def categories
  @categories
end

#contentObject

Returns the value of attribute content.



4
5
6
# File 'lib/microby/h_entry.rb', line 4

def content
  @content
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/microby/h_entry.rb', line 4

def name
  @name
end

#published_atObject

Returns the value of attribute published_at.



4
5
6
# File 'lib/microby/h_entry.rb', line 4

def published_at
  @published_at
end

#summaryObject

Returns the value of attribute summary.



4
5
6
# File 'lib/microby/h_entry.rb', line 4

def summary
  @summary
end

Instance Method Details

#parse_elements(microformat) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/microby/h_entry.rb', line 12

def parse_elements(microformat)
  FormatClass.each do |letter|
    microformat.css(">*[class*=#{letter}-]").each do |attrs|
      attrs["class"].split.each do |klass|
        parse_element(attrs, klass)
      end
    end
  end
end