class Crowbar::Client::Command::Role::Show
Implementation for the role show command
Public Instance Methods
execute()
click to toggle source
# File lib/crowbar/client/command/role/show.rb, line 36 def execute validate_barclamp! args.barclamp request.process do |request| case request.code when 200 formatter = Formatter::Array.new( format: provide_format, headings: ["Nodes available to assign the role"], values: Filter::Array.new( filter: provide_filter, values: content_from(request) ).result ) if formatter.empty? err "No nodes available to assign the role" else say formatter.result end when 404 err "Role does not exist" else err request.parsed_response["error"] end end end
request()
click to toggle source
# File lib/crowbar/client/command/role/show.rb, line 30 def request @request ||= Request::Role::Show.new( args ) end
Protected Instance Methods
content_from(request)
click to toggle source
# File lib/crowbar/client/command/role/show.rb, line 66 def content_from(request) request.parsed_response.sort end