Module: Trellatin::Persistence::ClassMethods
- Defined in:
- lib/trellatin/persistence.rb
Instance Method Summary collapse
- #configure_client ⇒ Object
- #set_board ⇒ Object
- #set_list ⇒ Object
- #set_owner ⇒ Object
- #set_trello_objects ⇒ Object
- #trellatin(options = {}) ⇒ Object
Instance Method Details
#configure_client ⇒ Object
28 29 30 31 32 33 |
# File 'lib/trellatin/persistence.rb', line 28 def configure_client Trello.configure do |config| config.developer_public_key = [:app_key] || Trellatin::Config.app_key config.member_token = [:token] || Trellatin::Config.token end end |
#set_board ⇒ Object
45 46 47 |
# File 'lib/trellatin/persistence.rb', line 45 def set_board self.board = owner.boards.select { |b| b.name == [:board] }.first end |
#set_list ⇒ Object
49 50 51 |
# File 'lib/trellatin/persistence.rb', line 49 def set_list self.list = board.lists.select { |l| l.name == [:list] }.first end |
#set_owner ⇒ Object
41 42 43 |
# File 'lib/trellatin/persistence.rb', line 41 def set_owner self.owner = Trello::Member.find([:owner]) end |
#set_trello_objects ⇒ Object
35 36 37 38 39 |
# File 'lib/trellatin/persistence.rb', line 35 def set_trello_objects self.set_owner self.set_board self.set_list end |
#trellatin(options = {}) ⇒ Object
53 54 55 56 57 |
# File 'lib/trellatin/persistence.rb', line 53 def trellatin( = {}) self. = configure_client set_trello_objects end |