diff options
| author | Teddy Wing | 2014-06-08 12:19:48 -0400 | 
|---|---|---|
| committer | Teddy Wing | 2014-06-08 12:19:48 -0400 | 
| commit | bf52bc3a520bff96be32cfb815738660a607f3ab (patch) | |
| tree | 2752aedad137cc8763c3b9e19372ab9bac444afd /fancy_bear/contextio | |
| parent | b41ddb4aa9944057d4dfee5a4b9662dc8326d124 (diff) | |
| download | sellevate-bf52bc3a520bff96be32cfb815738660a607f3ab.tar.bz2 | |
Create JSON route for message list
Create a route to get a list of messages in JSON, tied to a hard-coded
email account for now.
Diffstat (limited to 'fancy_bear/contextio')
| -rw-r--r-- | fancy_bear/contextio/message.rb | 33 | 
1 files changed, 33 insertions, 0 deletions
| diff --git a/fancy_bear/contextio/message.rb b/fancy_bear/contextio/message.rb new file mode 100644 index 0000000..ba9e00c --- /dev/null +++ b/fancy_bear/contextio/message.rb @@ -0,0 +1,33 @@ +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 +          } +        end +        messages +      end +       +      def get +         +      end +    end +     +  end +end | 
