Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/model.rb,
lib/support.rb
Instance Method Summary collapse
- #from_orient ⇒ Object (also: #reload!)
- #rid? ⇒ Boolean
- #to_classname ⇒ Object
- #to_or ⇒ Object
- #to_orient ⇒ Object
Instance Method Details
#from_orient ⇒ Object Also known as: reload!
16 17 18 19 20 21 22 |
# File 'lib/support.rb', line 16 def from_orient if rid? ActiveOrient::Model.autoload_object self else self end end |
#rid? ⇒ Boolean
13 14 15 |
# File 'lib/support.rb', line 13 def rid? self =~ /\A[#]{,1}[0-9]{1,}:[0-9]{1,}\z/ end |
#to_classname ⇒ Object
2 3 4 5 6 7 8 |
# File 'lib/support.rb', line 2 def to_classname if self[0] =='$' self[1..-1] else self.camelize end end |
#to_or ⇒ Object
2 3 4 |
# File 'lib/model.rb', line 2 def to_or "'#{self}'" end |
#to_orient ⇒ Object
9 10 11 12 |
# File 'lib/support.rb', line 9 def to_orient self.gsub /%/, '(percent)' end |