Class: Syobocal::Comment::Element::Text

Inherits:
Object
  • Object
show all
Defined in:
lib/syobocal/comment/element/text.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ Text

Returns a new instance of Text.



7
8
9
# File 'lib/syobocal/comment/element/text.rb', line 7

def initialize(str)
  @str = str
end

Instance Attribute Details

#strObject (readonly)

Returns the value of attribute str.



5
6
7
# File 'lib/syobocal/comment/element/text.rb', line 5

def str
  @str
end

Class Method Details

.create(text) ⇒ Object



15
16
17
# File 'lib/syobocal/comment/element/text.rb', line 15

def self.create(text)
  new(text)
end

Instance Method Details

#==(other) ⇒ Object



11
12
13
# File 'lib/syobocal/comment/element/text.rb', line 11

def ==(other)
  other.instance_of?(self.class) && other.str == str
end