Class: Docker::ContainerPathStat
- Inherits:
-
Object
- Object
- Docker::ContainerPathStat
show all
- Defined in:
- lib/drydock/docker_api_patch.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of ContainerPathStat.
63
64
65
|
# File 'lib/drydock/docker_api_patch.rb', line 63
def initialize(definition)
@data = JSON.parse(Base64.decode64(definition))
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *method_args, &blk) ⇒ Object
71
72
73
74
75
76
77
|
# File 'lib/drydock/docker_api_patch.rb', line 71
def method_missing(method_name, *method_args, &blk)
if mode.respond_to?(method_name)
mode.public_send(method_name, *method_args, &blk)
else
super
end
end
|
Instance Method Details
#link_target ⇒ Object
67
68
69
|
# File 'lib/drydock/docker_api_patch.rb', line 67
def link_target
@data.fetch('linkTarget')
end
|
#mode ⇒ Object
79
80
81
|
# File 'lib/drydock/docker_api_patch.rb', line 79
def mode
@mode ||= UniversalFileMode.new(@data.fetch('mode'))
end
|
#mtime ⇒ Object
83
84
85
|
# File 'lib/drydock/docker_api_patch.rb', line 83
def mtime
@mtime ||= DateTime.parse(@data.fetch('mtime'))
end
|
#name ⇒ Object
87
88
89
|
# File 'lib/drydock/docker_api_patch.rb', line 87
def name
@data.fetch('name')
end
|
#respond_to?(method_name) ⇒ Boolean
91
92
93
|
# File 'lib/drydock/docker_api_patch.rb', line 91
def respond_to?(method_name)
mode.respond_to?(method_name) || super
end
|
#size ⇒ Object
95
96
97
|
# File 'lib/drydock/docker_api_patch.rb', line 95
def size
@data.fetch('size')
end
|