aboutsummaryrefslogtreecommitdiffstats
path: root/fancy_bear
diff options
context:
space:
mode:
authorTeddy Wing2014-06-08 12:31:40 -0400
committerTeddy Wing2014-06-08 12:31:40 -0400
commit12477d778030901fe69e001ca9d1a856ccfd11ce (patch)
tree3e23a3bf88f4b24f9541cffec3037b409c610b7a /fancy_bear
parentf1a17c22776c6affd5fd48d5dd519510f5907431 (diff)
parentd9fb8accb78af12c544c81cb13ea35bbbebf0bac (diff)
downloadsellevate-12477d778030901fe69e001ca9d1a856ccfd11ce.tar.bz2
Merge branch 'feature/contextio-messages' into develop
Diffstat (limited to 'fancy_bear')
-rw-r--r--fancy_bear/contextio.rb1
-rw-r--r--fancy_bear/contextio/message.rb34
2 files changed, 35 insertions, 0 deletions
diff --git a/fancy_bear/contextio.rb b/fancy_bear/contextio.rb
index a7198e1..2750755 100644
--- a/fancy_bear/contextio.rb
+++ b/fancy_bear/contextio.rb
@@ -2,6 +2,7 @@ require_relative 'contextio/config'
require_relative 'contextio/base'
require_relative 'contextio/auth'
require_relative 'contextio/label'
+require_relative 'contextio/message'
module FancyBear
module ContextIO
diff --git a/fancy_bear/contextio/message.rb b/fancy_bear/contextio/message.rb
new file mode 100644
index 0000000..bae9be4
--- /dev/null
+++ b/fancy_bear/contextio/message.rb
@@ -0,0 +1,34 @@
+require 'contextio'
+
+module FancyBear
+ module ContextIO
+
+ class Message < Base
+ def initialize(email)
+ super()
+
+ @account = @contextio.accounts.where(:email => email).first
+ end
+
+ def all
+ messages = []
+ @account.messages.each do |m|
+ messages << {
+ :id => m.message_id,
+ :from_address => m.from['email'],
+ :from_name => m.from['name'],
+ :subject => m.subject,
+ :timestamp => m.date,
+ :labels => m.folders
+ }
+ end
+ messages
+ end
+
+ def get
+
+ end
+ end
+
+ end
+end