Class: Weskit::WML::Attributes

Inherits:
Items show all
Defined in:
lib/weskit/wml/attributes.rb

Instance Attribute Summary

Attributes inherited from Items

#contents

Instance Method Summary collapse

Methods inherited from Items

#formatter, #formatter=, #initialize, #to_s

Methods included from Mixins::Container

#attributes, #build, #delete, #elements, #exists?, #push

Methods included from Mixins::Validator

raise_if_invalid, raise_if_missing, raise_unless

Constructor Details

This class inherits a constructor from Weskit::WML::Items

Instance Method Details

#<<(item) ⇒ Object



11
12
13
14
# File 'lib/weskit/wml/attributes.rb', line 11

def << item
  append_attribute item
  self
end

#[](name) ⇒ Object



6
7
8
9
# File 'lib/weskit/wml/attributes.rb', line 6

def [] name
  name = ::Weskit::WML::Item.identifier name
  attribute(name).value
end