Class: Joint::AttachmentProxy
- Inherits:
-
Object
- Object
- Joint::AttachmentProxy
show all
- Defined in:
- lib/joint/attachment_proxy.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of AttachmentProxy.
3
4
5
|
# File 'lib/joint/attachment_proxy.rb', line 3
def initialize(instance, name)
@instance, @name = instance, name
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
32
33
34
|
# File 'lib/joint/attachment_proxy.rb', line 32
def method_missing(method, *args, &block)
grid_io.send(method, *args, &block)
end
|
Instance Method Details
#grid_io ⇒ Object
28
29
30
|
# File 'lib/joint/attachment_proxy.rb', line 28
def grid_io
@grid_io ||= @instance.grid.get(id)
end
|
#id ⇒ Object
7
8
9
|
# File 'lib/joint/attachment_proxy.rb', line 7
def id
@instance.send("#{@name}_id")
end
|
#name ⇒ Object
11
12
13
|
# File 'lib/joint/attachment_proxy.rb', line 11
def name
@instance.send("#{@name}_name")
end
|
#nil? ⇒ Boolean
Also known as:
blank?
23
24
25
|
# File 'lib/joint/attachment_proxy.rb', line 23
def nil?
!@instance.send("#{@name}?")
end
|
#size ⇒ Object
15
16
17
|
# File 'lib/joint/attachment_proxy.rb', line 15
def size
@instance.send("#{@name}_size")
end
|
#type ⇒ Object
19
20
21
|
# File 'lib/joint/attachment_proxy.rb', line 19
def type
@instance.send("#{@name}_type")
end
|