Class: RSolr::Message::Field

Inherits:
Object
  • Object
show all
Defined in:
lib/rsolr/message.rb

Overview

A class that represents a “doc”/“field” xml element for a solr update

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs, value) ⇒ Field

“attrs” must be a hash “value” should be something that responds to #_to_s



54
55
56
57
# File 'lib/rsolr/message.rb', line 54

def initialize(attrs, value)
  @attrs = attrs
  @value = value
end

Instance Attribute Details

#attrsObject

“attrs” is a hash for setting the “doc” xml attributes “value” is the text value for the node



50
51
52
# File 'lib/rsolr/message.rb', line 50

def attrs
  @attrs
end

#valueObject

“attrs” is a hash for setting the “doc” xml attributes “value” is the text value for the node



50
51
52
# File 'lib/rsolr/message.rb', line 50

def value
  @value
end

Instance Method Details

#nameObject

the value of the “name” attribute



60
61
62
# File 'lib/rsolr/message.rb', line 60

def name
  @attrs[:name]
end