Module: HammerCLI::Apipie::Resource

Included in:
Command
Defined in:
lib/hammer_cli/apipie/resource.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
# File 'lib/hammer_cli/apipie/resource.rb', line 5

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#actionObject



13
14
15
# File 'lib/hammer_cli/apipie/resource.rb', line 13

def action
  self.class.action
end

#connection_optionsObject



21
22
23
# File 'lib/hammer_cli/apipie/resource.rb', line 21

def connection_options
  self.class.connection_options
end

#parent_command_resourceObject



25
26
27
# File 'lib/hammer_cli/apipie/resource.rb', line 25

def parent_command_resource
  self.parent_command.class.respond_to?(:resource) && self.parent_command.class.resource
end

#resourceObject



9
10
11
# File 'lib/hammer_cli/apipie/resource.rb', line 9

def resource
  self.class.resource || parent_command_resource || nil
end

#resource_configObject



17
18
19
# File 'lib/hammer_cli/apipie/resource.rb', line 17

def resource_config
  self.class.resource_config
end