Sha256: 5a9eefbea17b517dc534974e13481f297876bd425fc8b7efed33c3c94557053b

Contents?: true

Size: 622 Bytes

Versions: 10

Compression:

Stored size: 622 Bytes

Contents

module Weskit::WML
  class Element < Item
    include Mixins::Container, Mixins::Searchable, Mixins::Validator

    attachable_to :parent
    
    attr_reader :contents

    def << item
      (append? item) ? append(item) : add(item)
      item.attach_to self
      self
    end

    def amendment= bool
      @amendment = bool ? true : false
    end

    def amendment?
      @amendment
    end

    def find name, nested = false
      find_elements name, nested
    end

    alias_method :method_missing, :find

    def initialize name, defaults = {}
      @amendment, @contents = false, []
      super
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
weskit-0.3.6 lib/weskit/wml/element.rb
weskit-0.3.5 lib/weskit/wml/element.rb
weskit-0.3.4 lib/weskit/wml/element.rb
weskit-0.3.3 lib/weskit/wml/element.rb
weskit-0.3.2 lib/weskit/wml/element.rb
weskit-0.3.1 lib/weskit/wml/element.rb
weskit-0.3.0 lib/weskit/wml/element.rb
weskit-0.2.1 lib/weskit/wml/element.rb
weskit-0.2.0 lib/weskit/wml/element.rb
weskit-0.1.0 lib/weskit/wml/element.rb