Class: Weekdone::Cli::Item

Inherits:
Thor
  • Object
show all
Includes:
Weekdone::Cli
Defined in:
lib/weekdone/cli/command_item.rb

Constant Summary

Constants included from Weekdone::Cli

VERSION

Instance Method Summary collapse

Methods included from Weekdone::Cli

#build_client

Instance Method Details

#getCommentsObject



36
37
38
39
40
41
42
# File 'lib/weekdone/cli/command_item.rb', line 36

def getComments
  client = build_client

  comments = client.getItemComments(options[:itemid])
  Credential.write_credential(client.token_hash)
  Output.format(comments, :json)
end

#likesObject



25
26
27
28
29
30
31
# File 'lib/weekdone/cli/command_item.rb', line 25

def likes
  client = build_client

  likes = client.getItemLikes(options[:itemid])
  Credential.write_credential(client.token_hash)
  Output.format(likes, format: :json)
end

#searchObject



15
16
17
18
19
20
21
# File 'lib/weekdone/cli/command_item.rb', line 15

def search
  client = build_client

  items = client.searchForItems(user_id: options[:userid])
  Credential.write_credential(client.token_hash)
  Output.format(items, format: :json)
end