Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 21c61916ba
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 77 lines (63 sloc) 2.471 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
using System;
using System.Text;
using System.Collections.Generic;
using IronRuby.Builtins;
using IronRuby.Runtime;
using Microsoft.Scripting;
using Microsoft.Scripting.Runtime;

namespace IronRuby.Hpricot {
[RubyClass("Elem", Inherits = typeof(BaseElement), DefineIn = typeof(Hpricot))]
    public class Element : BaseElement {
        public Element(ScannerState state)
            : this(state.Context) {
        }

        public Element(RubyContext context)
            : base(context, new ElementData()) {
        }

[RubyConstructor]
        public static Element Allocator(RubyClass/*!*/ self) {
            return new Element(self.Context);
        }

[RubyMethod("raw_string")]
        public static Object GetRawString(Element/*!*/ self) {
            return (self._data as ElementData).Raw;
        }

[RubyMethod("clear_raw")]
        public static bool ClearRaw(Element/*!*/ self) {
            (self._data as ElementData).Raw = null;
            return true;
        }

[RubyMethod("raw_attributes")]
        public static Object GetRawAttributes(Element/*!*/ self) {
            return (self._data as ElementData).Attr;
        }

[RubyMethod("raw_attributes=")]
        public static void SetRawAttributes(Element/*!*/ self, Object/*!*/ rawAttributes) {
            (self._data as ElementData).Attr = rawAttributes;
        }

[RubyMethod("children")]
        public static IList<Object> GetChildren(Element/*!*/ self) {
            return (self._data as ElementData).Children;
        }

[RubyMethod("children=")]
        public static void SetChildren(Element/*!*/ self, IList<Object>/*!*/ children) {
            (self._data as ElementData).Children = children;
        }

[RubyMethod("etag")]
        public static IHpricotDataContainer GetEtag(Element/*!*/ self) {
            return (self._data as ElementData).ETag;
        }

[RubyMethod("etag=")]
        public static void SetEtag(Element/*!*/ self, IHpricotDataContainer/*!*/ etag) {
            (self._data as ElementData).ETag = etag;
        }

[RubyMethod("name")]
        public static Object GetName(Element/*!*/ self) {
            return self._data.Tag;
        }

[RubyMethod("name=")]
        public static void SetName(Element/*!*/ self, Object/*!*/ name) {
            self._data.Tag = name;
        }
    }
}
Something went wrong with that request. Please try again.