Class: Dashdate::App

Inherits:
Object
  • Object
show all
Defined in:
lib/app.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(publisher, arg_parser) ⇒ App

Returns a new instance of App.



10
11
12
13
# File 'lib/app.rb', line 10

def initialize publisher, arg_parser
  @publisher = publisher
  @arg_parser = arg_parser
end

Instance Attribute Details

#arg_parserObject

Returns the value of attribute arg_parser.



6
7
8
# File 'lib/app.rb', line 6

def arg_parser
  @arg_parser
end

#publisherObject

Returns the value of attribute publisher.



6
7
8
# File 'lib/app.rb', line 6

def publisher
  @publisher
end

Class Method Details

.buildObject



7
8
9
# File 'lib/app.rb', line 7

def self.build
  new(Dashdate::Publisher.build, Dashdate::ArgParser.new)
end

Instance Method Details

#handle_args(args) ⇒ Object



14
15
16
17
# File 'lib/app.rb', line 14

def handle_args args
  parsed = @arg_parser.parse(args)
  @publisher.update(parsed[:widget], parsed[:values], parsed[:auth])
end