44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
# File 'lib/bootic_cli/console.rb', line 44
def explain_link(entity, key)
return "This entity does not appear to have links" unless entity.respond_to?(:rels)
rel = entity.rels[key.to_sym]
return "This entity does not have link '#{key}'" unless rel
data = [
['name', key],
['type', rel.type],
['title', rel.title],
['method', rel.transport_method],
['docs', rel.docs],
['href', rel.href],
['parameters', rel.parameters.join(', ')]
]
puts table(data)
puts ''
token = session.config[:access_token]
puts %(curl -i -H "Authorization: Bearer #{token}" "#{rel.href}")
nil
end
|