Module: ActsAsFerret::RdigAdapter::InstanceMethods

Defined in:
lib/acts_as_ferret/rdig_adapter.rb

Instance Method Summary collapse

Instance Method Details

#contentObject

Content of the document. Use the :content_tag_selector option to declare the hpricot expression that should be used for selecting the content for this field.



128
129
130
# File 'lib/acts_as_ferret/rdig_adapter.rb', line 128

def content
  @rdig_document.body
end

#ferret_key_with_md5Object



137
138
139
# File 'lib/acts_as_ferret/rdig_adapter.rb', line 137

def ferret_key_with_md5
  Digest::MD5.hexdigest(ferret_key_without_md5)
end

#idObject

Url of this document.



133
134
135
# File 'lib/acts_as_ferret/rdig_adapter.rb', line 133

def id
  @id
end

#initialize(uri, rdig_document = nil) ⇒ Object



113
114
115
116
# File 'lib/acts_as_ferret/rdig_adapter.rb', line 113

def initialize(uri, rdig_document = nil)
  @id = uri
  @rdig_document = rdig_document
end

#titleObject

Title of the document. Use the :title_tag_selector option to declare the hpricot expression that should be used for selecting the content for this field.



121
122
123
# File 'lib/acts_as_ferret/rdig_adapter.rb', line 121

def title
  @rdig_document.title
end

#to_sObject



141
142
143
# File 'lib/acts_as_ferret/rdig_adapter.rb', line 141

def to_s
  "Page at #{id}, title: #{title}"
end