Class: Cardigan::Command::ShowEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/cardigan/command/show_entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entry, io) ⇒ ShowEntry

Returns a new instance of ShowEntry.



6
7
8
9
10
# File 'lib/cardigan/command/show_entry.rb', line 6

def initialize entry, io
  @entry, @io = entry, io
  @usage = ''
  @help = 'Shows the entire content of the entry'
end

Instance Attribute Details

#helpObject (readonly)

Returns the value of attribute help.



4
5
6
# File 'lib/cardigan/command/show_entry.rb', line 4

def help
  @help
end

#usageObject (readonly)

Returns the value of attribute usage.



4
5
6
# File 'lib/cardigan/command/show_entry.rb', line 4

def usage
  @usage
end

Instance Method Details

#execute(ignored = nil) ⇒ Object



12
13
14
# File 'lib/cardigan/command/show_entry.rb', line 12

def execute ignored=nil
  @entry.keys.sort.each { |key| @io.say "#{key}: #{@entry[key].inspect}" }
end