Class: TwitterHashtag::CLI

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hashtag, args) ⇒ CLI

Returns a new instance of CLI.



8
9
10
11
# File 'lib/twitter_hashtag/cli.rb', line 8

def initialize(hashtag, args)
  @hashtag = hashtag
  @args = args
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



13
14
15
# File 'lib/twitter_hashtag/cli.rb', line 13

def args
  @args
end

#hashtagObject (readonly)

Returns the value of attribute hashtag.



13
14
15
# File 'lib/twitter_hashtag/cli.rb', line 13

def hashtag
  @hashtag
end

Instance Method Details

#processObject



15
16
17
# File 'lib/twitter_hashtag/cli.rb', line 15

def process
  hashtag == 'help' ? render_help : search
end