Class: Agio::Data

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

Overview

A simple wrapper around string data in an HTML document.

Direct Known Subclasses

CData, Comment

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Data

Returns a new instance of Data.



6
7
8
# File 'lib/agio/data.rb', line 6

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



10
11
12
# File 'lib/agio/data.rb', line 10

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object

Used mostly for testing.



26
27
28
29
30
31
32
# File 'lib/agio/data.rb', line 26

def ==(other)
  if other.kind_of? Agio::Data
    self.class == other.class && value == other.value
  else
    value == other
  end
end

#inspectObject



20
21
22
# File 'lib/agio/data.rb', line 20

def inspect
  %Q(#<#{self.class} #{value.inspect}>)
end

#to_sObject



12
13
14
# File 'lib/agio/data.rb', line 12

def to_s
  value
end

#to_strObject



16
17
18
# File 'lib/agio/data.rb', line 16

def to_str
  value
end