Module: ConsoleUpdate

Defined in:
lib/console_update.rb,
lib/console_update/filter.rb,
lib/console_update/version.rb,
lib/console_update/filter/yaml.rb,
lib/console_update/named_scope.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods, NamedScope, SingletonMethods Classes: Filter

Constant Summary collapse

VERSION =
'0.1.6'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.editorObject

Returns the value of attribute editor.



7
8
9
# File 'lib/console_update.rb', line 7

def editor
  @editor
end

.filterObject

Returns the value of attribute filter.



7
8
9
# File 'lib/console_update.rb', line 7

def filter
  @filter
end

Class Method Details

.enable_named_scopeObject

Adds a global scoped method, console_update(), which can be chained to the end of any named scopes. For example, if Url has a named scope :tagged_with:

Url.tagged_with('physics').console_update


7
8
9
# File 'lib/console_update/named_scope.rb', line 7

def self.enable_named_scope  
  ActiveRecord::NamedScope::Scope.send :include, NamedScope
end

.included(base) ⇒ Object

:nodoc:



8
9
10
11
12
# File 'lib/console_update.rb', line 8

def self.included(base) #:nodoc:
  @filter = :yaml
  @editor = ENV["EDITOR"]
  base.extend ClassMethods
end