Sha256: e423c04df0ef594d37fd87aebfee8760842a2693b1481ae06d31de7ab8e5fe48

Contents?: true

Size: 349 Bytes

Versions: 10

Compression:

Stored size: 349 Bytes

Contents

module WoopraRails::Response
  class << self
    attr_accessor :success
    def new(json=nil)
      if json
        JSON.parse(json).each do |k,v|
          self.send("#{k}=".to_sym, v)
        end
      end
      self
    end

    def success?
      return true if self.send(:success) == 1 || WoopraRails.dryrun
      return false
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
woopra_rails-1.1.6 lib/woopra_rails/response.rb
woopra_rails-1.1.5 lib/woopra_rails/response.rb
woopra_rails-1.1.3 lib/woopra_rails/response.rb
woopra_rails-1.1.2 lib/woopra_rails/response.rb
woopra_rails-1.1.1 lib/woopra_rails/response.rb
woopra_rails-1.1 lib/woopra_rails/response.rb
woopra_rails-1.0.10 lib/woopra_rails/response.rb
woopra_rails-1.0.9 lib/woopra_rails/response.rb
woopra_rails-1.0.8 lib/woopra_rails/response.rb
woopra_rails-1.0.7 lib/woopra_rails/response.rb