Class: Praxis::Mapper::SelectorGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/praxis/mapper/selector_generator.rb

Overview

Generates a set of selectors given a resource and list of resource attributes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#rootObject (readonly)

Returns the value of attribute root.



310
311
312
# File 'lib/praxis/mapper/selector_generator.rb', line 310

def root
  @root
end

Instance Method Details

#add(resource, fields) ⇒ Object

Entry point



313
314
315
316
317
# File 'lib/praxis/mapper/selector_generator.rb', line 313

def add(resource, fields)
  @root = SelectorGeneratorNode.new(resource)
  @root.add(fields)
  self
end

#inspectObject



323
324
325
# File 'lib/praxis/mapper/selector_generator.rb', line 323

def inspect
  "#<#{self.class} @resource=#{@resource.name.inspect} @select=#{@select.inspect} @select_star=#{@select_star.inspect} @tracking.keys=#{@tracks.keys} (recursion omitted)>"
end

#selectorsObject



319
320
321
# File 'lib/praxis/mapper/selector_generator.rb', line 319

def selectors
  @root
end