Class: Looks::Command::Addresses
- Inherits:
-
AccountManagement
- Object
- Base
- AccountManagement
- Looks::Command::Addresses
- Defined in:
- lib/looks/command/addresses.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #configure(opts) ⇒ Object
- #execute(args) ⇒ Object
-
#initialize(config) ⇒ Addresses
constructor
A new instance of Addresses.
Methods inherited from Base
Constructor Details
#initialize(config) ⇒ Addresses
Returns a new instance of Addresses.
8 9 10 11 12 |
# File 'lib/looks/command/addresses.rb', line 8 def initialize(config) super @verbose = false end |
Instance Method Details
#configure(opts) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/looks/command/addresses.rb', line 14 def configure(opts) super opts.separator "" opts.separator "Options:" opts.on('-v', '--verbose', "Be verbose") do |address| @verbose = true end end |
#execute(args) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/looks/command/addresses.rb', line 25 def execute(args) super addresses = Gravatar::Account.new(config).addresses if @verbose addresses.each do |address| puts "#{address.email}" puts " #{address.image.id}" unless address.image.nil? end else puts addresses end end |