Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/atom/xml/parser.rb

Overview

:nodoc:

Direct Known Subclasses

Atom::Content::Base

Instance Method Summary (collapse)

Instance Method Details

- (Object) constantize



25
26
27
# File 'lib/atom/xml/parser.rb', line 25

def constantize
  Object.module_eval("::#{self}", __FILE__, __LINE__)
end

- (Object) demodulize



21
22
23
# File 'lib/atom/xml/parser.rb', line 21

def demodulize
  self.sub(/.*::/, '')
end

- (Object) singularize



13
14
15
16
17
18
19
# File 'lib/atom/xml/parser.rb', line 13

def singularize
  if self =~ /ies$/
    self.sub(/ies$/, 'y')
  else
    self.sub(/s$/, '')
  end
end