Class: Picturelife::Stub

Inherits:
Object
  • Object
show all
Defined in:
lib/picturelife/stub.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(module_name) ⇒ Stub

Returns a new instance of Stub.


11
12
13
# File 'lib/picturelife/stub.rb', line 11

def initialize(module_name)
  @module_name = module_name
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, args = nil) ⇒ Object


15
16
17
18
# File 'lib/picturelife/stub.rb', line 15

def method_missing(name, args = nil)
  method = [module_name, name].join('/')
  Api.call(method, args)
end

Instance Attribute Details

#module_nameObject (readonly)

Returns the value of attribute module_name.


9
10
11
# File 'lib/picturelife/stub.rb', line 9

def module_name
  @module_name
end