Class: Trelloize
- Inherits:
-
Object
- Object
- Trelloize
- Defined in:
- lib/totrello/trelloize.rb
Overview
Trelloize
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#directory ⇒ Object
Returns the value of attribute directory.
-
#trello ⇒ Object
Returns the value of attribute trello.
Instance Method Summary collapse
- #description(todo, config) ⇒ Object
- #find_and_create_cards_from_todos(todos, board) ⇒ Object
-
#initialize(directory = Dir.pwd.to_s) ⇒ Trelloize
constructor
A new instance of Trelloize.
Constructor Details
#initialize(directory = Dir.pwd.to_s) ⇒ Trelloize
Returns a new instance of Trelloize.
10 11 12 13 14 |
# File 'lib/totrello/trelloize.rb', line 10 def initialize(directory = Dir.pwd.to_s) @trello = TrelloBuilder.new @directory = directory @config = TrelloConfig.new(directory) end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
8 9 10 |
# File 'lib/totrello/trelloize.rb', line 8 def config @config end |
#directory ⇒ Object
Returns the value of attribute directory.
8 9 10 |
# File 'lib/totrello/trelloize.rb', line 8 def directory @directory end |
#trello ⇒ Object
Returns the value of attribute trello.
8 9 10 |
# File 'lib/totrello/trelloize.rb', line 8 def trello @trello end |
Instance Method Details
#description(todo, config) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/totrello/trelloize.rb', line 16 def description(todo, config) return '' if todo.nil? out = 'TODO item found by the ' out += "[ToTrello](https://rubygems.org/gems/totrello) gem\n" out += "**Project name:** #{config.project_name}\n" out += "**Filename**: #{todo[:file]}\n" out += "**Action item**: #{todo[:todo]}\n" out + "**Location (at or near) line**: #{todo[:line_number]}\n" end |
#find_and_create_cards_from_todos(todos, board) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/totrello/trelloize.rb', line 26 def find_and_create_cards_from_todos(todos, board) todos.each do |todo| description = description(todo, @config) @trello.create_card(board, todo[:todo], description, @config.default_list) end end |