Class: Appscript::Reference

Inherits:
Object
  • Object
show all
Defined in:
lib/appscript/reference.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#identifyObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/appscript/reference.rb', line 9

def identify
  name = self.to_s.match(/Things.app"\)\.([^\.]*)/)[1]

  begin
    name = name.gsub('_', '')
    # inflections
    name = 'persons' if name == 'people'
    Things.const_get(name.capitalize[0..-2]) 
  rescue NameError
    nil
  end
end

#todosObject

:nodoc:



5
6
7
# File 'lib/appscript/reference.rb', line 5

def todos
  to_dos
end