Sha256: 096b36716c44552a479ffba774e24f5ebb3aa05ab65036553f4ceb7b380cf646

Contents?: true

Size: 612 Bytes

Versions: 14

Compression:

Stored size: 612 Bytes

Contents

module SparkApi
  module Models
    class Message < Base
      self.element_name="messages"
      
      def save(arguments={})
        begin
          return save!(arguments)
        rescue BadResourceRequest => e
          SparkApi.logger.warn("Failed to save resource #{self}: #{e.message}")
        rescue NotFound => e
          SparkApi.logger.error("Failed to save resource #{self}: #{e.message}")
        end
        false
      end
      def save!(arguments={})
        results = connection.post self.class.path, {"Messages" => [ attributes ]}, arguments
        true
      end
      
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
spark_api-1.3.23 lib/spark_api/models/message.rb
spark_api-1.3.21 lib/spark_api/models/message.rb
spark_api-1.3.20 lib/spark_api/models/message.rb
spark_api-1.3.19 lib/spark_api/models/message.rb
spark_api-1.3.18 lib/spark_api/models/message.rb
spark_api-1.3.17 lib/spark_api/models/message.rb
spark_api-1.3.16 lib/spark_api/models/message.rb
spark_api-1.3.15 lib/spark_api/models/message.rb
spark_api-1.3.14 lib/spark_api/models/message.rb
spark_api-1.3.13 lib/spark_api/models/message.rb
spark_api-1.3.10 lib/spark_api/models/message.rb
spark_api-1.3.9 lib/spark_api/models/message.rb
spark_api-1.3.6 lib/spark_api/models/message.rb
spark_api-1.3.3 lib/spark_api/models/message.rb