Module: Noveku::Proxy

Included in:
Core
Defined in:
lib/noveku/proxy.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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

If this is a command with no specific support, pass the raw arguments to ‘heroku` directly



9
10
11
12
13
14
15
# File 'lib/noveku/proxy.rb', line 9

def method_missing(name, *args, &block)
  if name.to_s.end_with?('_cmd')
    execute_heroku proxy_cmd_str
  else
    super
  end
end

Instance Method Details

#proxy_cmd_strObject

String to execute when proxying commands



4
5
6
# File 'lib/noveku/proxy.rb', line 4

def proxy_cmd_str
  ([@command] + proxied_arguments).join(' ')
end

#respond_to_missing?(name, include_private) ⇒ Boolean

Expose proxying handling

Returns:

  • (Boolean)


18
19
20
21
22
23
24
# File 'lib/noveku/proxy.rb', line 18

def respond_to_missing?(name, include_private)
  if name.to_s.end_with?('_cmd')
    true
  else
    super
  end
end