Sha256: c0c1e31b67c043d7b629ffc90777e2c749044af76743b00f39a8aa33fe2ced1b

Contents?: true

Size: 578 Bytes

Versions: 2

Compression:

Stored size: 578 Bytes

Contents

require 'restful_model'
require 'file'

module Inbox
  class Message < RestfulModel

    attr_accessor :subject
    attr_accessor :snippet
    attr_accessor :from
    attr_accessor :to
    attr_accessor :cc
    attr_accessor :bcc
    attr_accessor :date
    attr_accessor :thread_id
    attr_accessor :file_ids
    attr_accessor :body

    def inflate(json)
      super
      @file_ids ||= []
      @to ||= []
      @cc ||= []
      @bcc ||= []
    end

    def files
      @files ||= RestfulModelCollection.new(File, @_api, @namespace_id, {:message_id=>@id})
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
inbox-0.7.0 lib/message.rb
inbox-0.5.0 lib/message.rb