Module: Smug::Utils

Included in:
Command, StatusCommand
Defined in:
lib/smugsync/utils.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/smugsync/utils.rb', line 11

def method_missing(method, *args, &block)
    # if method looks like smugmug API call, call get()
    if method.to_s =~ /^smugmug_/
        get(method.to_s.gsub('_', '.'), *args, &block)
    else
        super(method, *args, &block)
    end
end

Instance Method Details

#status_message(message) ⇒ Object



6
7
8
9
# File 'lib/smugsync/utils.rb', line 6

def status_message(message)
    $stdout.print message
    $stdout.flush
end