Class: Microformat::ItemScope

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node, strict) ⇒ ItemScope

Returns a new instance of ItemScope.



60
61
62
63
64
65
66
67
# File 'lib/microformat.rb', line 60

def initialize(node, strict)
  @type = attr 'itemtype', node
  @id = attr 'itemid', node
  @properties = {}
  @strict = strict

  parse_elements node.search './*'
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



58
59
60
# File 'lib/microformat.rb', line 58

def id
  @id
end

#typeObject (readonly)

Returns the value of attribute type.



58
59
60
# File 'lib/microformat.rb', line 58

def type
  @type
end

Instance Method Details

#[](name) ⇒ Object



69
70
71
# File 'lib/microformat.rb', line 69

def [](name)
  @properties[name]
end