Sha256: ecf2bba0f328f26faeb996146ebf80638bc7aa52a251592825be64ee7f3d823c

Contents?: true

Size: 494 Bytes

Versions: 12

Compression:

Stored size: 494 Bytes

Contents

class WhowishWordFacebook

  include Mongoid::Document
  
  field :publish_id,:type=>String
  field :message, :type=>String
  field :name, :type=>String
  field :caption, :type=>String
  field :description, :type=>String
  
  key :publish_id

  def word_for(field,*p)

     content = self[field].to_s

     if p.length > 0
        p = p[0]

        p.each_pair { |key,val|
          content.gsub!("{"+key.to_s+"}",val.to_s)
        }
      end

    content
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
whowish_word-0.2.1 lib/legacy/whowish_word/lib/app/models/mongodb/whowish_word_facebook.rb
whowish_word-0.2.0 lib/legacy/whowish_word/lib/app/models/mongodb/whowish_word_facebook.rb
whowish_word-0.1.9 lib/legacy/whowish_word/lib/app/models/mongodb/whowish_word_facebook.rb
whowish_word-0.1.8 lib/legacy/whowish_word/lib/app/models/mongodb/whowish_word_facebook.rb
whowish_word-0.1.7 lib/legacy/whowish_word/lib/app/models/mongodb/whowish_word_facebook.rb
whowish_word-0.1.6 lib/legacy/whowish_word/lib/app/models/mongodb/whowish_word_facebook.rb
whowish_word-0.1.5 lib/legacy/whowish_word/lib/app/models/mongodb/whowish_word_facebook.rb
whowish_word-0.1.4 lib/legacy/whowish_word/lib/app/models/mongodb/whowish_word_facebook.rb
whowish_word-0.1.3 lib/legacy/whowish_word/lib/app/models/mongodb/whowish_word_facebook.rb
whowish_word-0.1.2 lib/legacy/whowish_word/lib/app/models/mongodb/whowish_word_facebook.rb
whowish_word-0.1.1 lib/legacy/whowish_word/lib/app/models/mongodb/whowish_word_facebook.rb
whowish_word-0.1.0 lib/legacy/whowish_word/lib/app/models/mongodb/whowish_word_facebook.rb