Class: Leeloo::Ascii

Inherits:
Output show all
Defined in:
lib/leeloo/output.rb

Direct Known Subclasses

Terminal

Instance Method Summary collapse

Methods inherited from Output

#render_share

Instance Method Details

#render_footprint(footprint) ⇒ Object



69
70
71
72
# File 'lib/leeloo/output.rb', line 69

def render_footprint footprint
    puts "token:"
    puts Base64.strict_encode64 footprint.to_json
end

#render_keys(keys) ⇒ Object



65
66
67
# File 'lib/leeloo/output.rb', line 65

def render_keys keys
    self.render_text keys
end

#render_name_and_secret(name, secret) ⇒ Object



55
56
57
58
59
# File 'lib/leeloo/output.rb', line 55

def render_name_and_secret name, secret
    self.render_text name
    self.render_secret secret
    self.render_text '------'
end

#render_preferences(preferences) ⇒ Object



39
40
41
# File 'lib/leeloo/output.rb', line 39

def render_preferences preferences
    preferences.keystores.each { |keystore| puts keystore.name }
end

#render_secret(secret) ⇒ Object



47
48
49
50
51
52
53
# File 'lib/leeloo/output.rb', line 47

def render_secret secret
    begin
        puts secret.read
    rescue => exception
        puts "#{secret.name} doesn't exist"
    end
end

#render_secrets(secrets) ⇒ Object



43
44
45
# File 'lib/leeloo/output.rb', line 43

def render_secrets secrets
    secrets.sort_by(&:name).each {|secret| puts secret.name}
end

#render_text(text) ⇒ Object



61
62
63
# File 'lib/leeloo/output.rb', line 61

def render_text text
    puts text
end