Class: FaceGroup::Runner
- Inherits:
-
Object
- Object
- FaceGroup::Runner
- Defined in:
- lib/facegroup/runner.rb
Overview
Executable code for file(s) in bin/ folder
Class Method Summary collapse
- .attachment_output(attachment) ⇒ Object
- .message_output(message) ⇒ Object
- .output_info(group) ⇒ Object
- .posting_info(post, index) ⇒ Object
- .run!(args) ⇒ Object
Class Method Details
.attachment_output(attachment) ⇒ Object
42 43 44 |
# File 'lib/facegroup/runner.rb', line 42 def self.() ? .url.to_s : '(none)' end |
.message_output(message) ⇒ Object
38 39 40 |
# File 'lib/facegroup/runner.rb', line 38 def self.() ? : '(blank)' end |
.output_info(group) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/facegroup/runner.rb', line 18 def self.output_info(group) name = group.name separator = Array.new(group.name.length) { '-' }.join group_info = group.feed.postings.first(3).map.with_index do |post, index| posting_info(post, index) end.join [name, separator, group_info].join("\n") end |
.posting_info(post, index) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/facegroup/runner.rb', line 29 def self.posting_info(post, index) [ "#{index + 1}: ", (post.), 'Attached: ' + (post.), "\n\n" ].join end |