Module: Ubiquitously::Command::Post::Opts
- Defined in:
- lib/ubiquitously/commands/post.rb
Instance Method Summary collapse
- #description ⇒ Object
- #help ⇒ Object
- #options(value = nil) ⇒ Object
- #password ⇒ Object
- #section(heading, &block) ⇒ Object
- #tags ⇒ Object
- #title ⇒ Object
- #url ⇒ Object
- #username ⇒ Object
Instance Method Details
#description ⇒ Object
82 83 84 85 86 |
# File 'lib/ubiquitously/commands/post.rb', line 82 def description on('-d', '--description DESCRIPTION', "Post description (required)") do |description| [:description] = description end end |
#help ⇒ Object
100 101 102 103 104 |
# File 'lib/ubiquitously/commands/post.rb', line 100 def help on_tail("-h", "--help", "Show this message") do exit end end |
#options(value = nil) ⇒ Object
52 53 54 55 |
# File 'lib/ubiquitously/commands/post.rb', line 52 def (value = nil) @options = value if value @options end |
#password ⇒ Object
94 95 96 97 98 |
# File 'lib/ubiquitously/commands/post.rb', line 94 def password on('-P', '--password [password]', "Password for service") do |password| [:password] = password end end |
#section(heading, &block) ⇒ Object
57 58 59 60 61 62 |
# File 'lib/ubiquitously/commands/post.rb', line 57 def section(heading, &block) separator "" separator heading instance_eval(&block) end |
#tags ⇒ Object
76 77 78 79 80 |
# File 'lib/ubiquitously/commands/post.rb', line 76 def on('-t', '--tags TAGS', "Post tags (required)") do || [:tags] = .split(/,(?:\s+)?/) end end |
#title ⇒ Object
70 71 72 73 74 |
# File 'lib/ubiquitously/commands/post.rb', line 70 def title on('-l', '--title TITLE', "Post title (required)") do |title| [:title] = title end end |
#url ⇒ Object
64 65 66 67 68 |
# File 'lib/ubiquitously/commands/post.rb', line 64 def url on('-u', '--url URL', "Post url (required)") do |url| [:url] = url end end |
#username ⇒ Object
88 89 90 91 92 |
# File 'lib/ubiquitously/commands/post.rb', line 88 def username on('-U', '--username [username]', "Username for service") do |username| [:username] = username end end |