Class: Proxmox::Base

Inherits:
Object
  • Object
show all
Extended by:
RestConnection
Includes:
RestConnection
Defined in:
lib/pve/proxmox.rb

Direct Known Subclasses

AplInfo, HA, Hosted, Node, Storage, Storage::Content, Task, Task::Status

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from RestConnection

bench, rest_del, rest_get, rest_post, rest_put

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



136
137
138
139
140
141
142
# File 'lib/pve/proxmox.rb', line 136

def method_missing method, *args, &exe
  if instance_variable_defined? "@#{method}"
    instance_variable_get "@#{method}"
  else
    super
  end
end

Instance Attribute Details

#sidObject (readonly)

Returns the value of attribute sid.



118
119
120
# File 'lib/pve/proxmox.rb', line 118

def sid
  @sid
end

Class Method Details

.__new__(data) ⇒ Object



121
122
123
124
# File 'lib/pve/proxmox.rb', line 121

def __new__ data
  n = allocate
  n.send :__update__, data
end

.fetch(predata) ⇒ Object



127
128
129
# File 'lib/pve/proxmox.rb', line 127

def fetch predata
  __new__( predata).refresh!
end

Instance Method Details

#refresh!Object



156
157
158
# File 'lib/pve/proxmox.rb', line 156

def refresh!
  __update__ rest_get( @rest_prefix)
end

#respond_to?(method, also_private = false) ⇒ Boolean

Returns:

  • (Boolean)


132
133
134
# File 'lib/pve/proxmox.rb', line 132

def respond_to? method, also_private = false
  instance_variable_defined?( "@#{method}") or super(method, also_private)
end