Class: Couchbase::Management::View

Inherits:
Object
  • Object
show all
Defined in:
lib/couchbase/management/view_index_manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(map = nil, reduce = nil) {|self| ... } ⇒ View

Returns a new instance of View.

Parameters:

  • map (String) (defaults to: nil)
  • reduce (String) (defaults to: nil)

Yield Parameters:



215
216
217
218
219
# File 'lib/couchbase/management/view_index_manager.rb', line 215

def initialize(map = nil, reduce = nil)
  @map_function = map
  @reduce_function = reduce
  yield self if block_given?
end

Instance Attribute Details

#map_functionString Also known as: map

Returns map function in javascript as String.

Returns:

  • (String)

    map function in javascript as String



194
195
196
# File 'lib/couchbase/management/view_index_manager.rb', line 194

def map_function
  @map_function
end

#reduce_functionString Also known as: reduce

Returns reduce function in javascript as String.

Returns:

  • (String)

    reduce function in javascript as String



198
199
200
# File 'lib/couchbase/management/view_index_manager.rb', line 198

def reduce_function
  @reduce_function
end

#viewString

Returns name of the view.

Returns:

  • (String)

    name of the view



191
192
193
# File 'lib/couchbase/management/view_index_manager.rb', line 191

def view
  @view
end

Instance Method Details

#has_map?Boolean

Returns true if map function is defined.

Returns:

  • (Boolean)

    true if map function is defined



202
203
204
# File 'lib/couchbase/management/view_index_manager.rb', line 202

def has_map?
  !@map_function.nil?
end

#has_reduce?Boolean

Returns true if map function is defined.

Returns:

  • (Boolean)

    true if map function is defined



207
208
209
# File 'lib/couchbase/management/view_index_manager.rb', line 207

def has_reduce?
  !@reduce_function.nil?
end