Module: Nwsdk

Defined in:
lib/nwsdk.rb,
lib/nwsdk/cli.rb,
lib/nwsdk/query.rb,
lib/nwsdk/values.rb,
lib/nwsdk/content.rb,
lib/nwsdk/helpers.rb,
lib/nwsdk/packets.rb,
lib/nwsdk/version.rb,
lib/nwsdk/endpoint.rb,
lib/nwsdk/timeline.rb,
lib/nwsdk/condition.rb,
lib/nwsdk/constants.rb

Defined Under Namespace

Modules: Constants, Helpers Classes: Cli, Condition, Content, Endpoint, Packets, Query, Timeline, Values

Constant Summary collapse

VERSION =
'1.1.3'

Class Method Summary collapse

Class Method Details

.setup_cli(options, where) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/nwsdk/cli.rb', line 8

def self.setup_cli(options, where)
  endpoint=Nwsdk::Endpoint.configure(options[:config])
  e=case options[:end]
    when nil?
      options[:start] + options[:span]
    else
      Chronic.parse(options[:end])
  end



  condition=Nwsdk::Condition.new(
    where: where,
    start: Chronic.parse(options[:start]),
    end:   e,
    span:  options[:span]
  )
  { endpoint: endpoint, condition: condition }
end