Class: SknUtils::CommandJSONPut
Overview
#################################################
Class Method Summary collapse
-
.call(options) ⇒ Object
full_url:,username:,userpass:,payload:,headers:.
Instance Method Summary collapse
Class Method Details
.call(options) ⇒ Object
full_url:,username:,userpass:,payload:,headers:
132 133 134 |
# File 'lib/skn_utils/job_commands.rb', line 132 def self.call() # {full_url:,username:,userpass:,payload:,headers:} new() end |
Instance Method Details
#json? ⇒ Boolean
136 137 138 |
# File 'lib/skn_utils/job_commands.rb', line 136 def json? true end |
#request ⇒ Object
144 145 146 147 148 149 150 |
# File 'lib/skn_utils/job_commands.rb', line 144 def request req = @_headers.nil? ? Net::HTTP::Put.new(uri.path) : Net::HTTP::Put.new(uri.path, @_headers) # Generate HTTPRequest object req.basic_auth(@_username, @_userpass) if credentials? req.content_type = 'application/json' req.body = formatted_data req end |
#uri ⇒ Object
140 141 142 |
# File 'lib/skn_utils/job_commands.rb', line 140 def uri @_uri end |