lib/riak/search/schema.rb in riak-client-2.2.0.pre1 vs lib/riak/search/schema.rb in riak-client-2.2.0
- old
+ new
@@ -25,27 +25,28 @@
# @return [String] the XML content of this schema
def content
schema_data.content
end
-
+
# @param [String] content the XML content of this schema
# @raise [Riak::SearchError::SchemaExistsError] if a schema with the given
# name already exists
def create!(content)
- raise Riak::SearchError::SchemaExistsError.new name if exists?
+ fail Riak::SearchError::SchemaExistsError.new name if exists?
@client.backend do |b|
b.create_search_schema name, content
end
-
+
@schema_data = nil
true
end
private
+
def schema_data
return @schema_data if defined?(@schema_data) && @schema_data
sd = nil
@@ -55,11 +56,10 @@
end
rescue Riak::ProtobuffsFailedRequest => e
return nil if e.not_found?
raise e
end
-
- return @schema_data = sd
+
+ @schema_data = sd
end
end
end
-