Sha256: 6de889fc081cde5949f7e3ccd69ebddeac7538578bf312b3e43bf0ad3072322c

Contents?: true

Size: 426 Bytes

Versions: 1

Compression:

Stored size: 426 Bytes

Contents

class Subject
  
  attr_reader :subject
  
  # FIXME subject is not a hash
  
  def initialize(object)
    @subject = {}
    object.each do |key, value|
       @subject["event[subject][#{key.to_s}]"] = value.to_s
    end
    @subject
  end
  
  def inspect
    @subject.inspect
  end

  # TODO def to_hash
  #   @subject = JSON.parse(@subject)  
  # end
  
  def to_json
    @subject = JSON.generate(@subject)    
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
eotb-0.1.5 lib/subject.rb