Class: Safrano::SelectBase

Inherits:
Object
  • Object
show all
Defined in:
lib/odata/select.rb

Overview

base class for selecting. We have to distinguish between fields of the current entity, and the navigation properties we can have one special case

empty, ie no $select specified --> return all fields and all nav props
          ==> SelectAll

Direct Known Subclasses

Select

Constant Summary collapse

ALL =

re-useable selecting-all handler

new

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.factory(selectstr, model) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/odata/select.rb', line 17

def self.factory(selectstr, model)
  case selectstr&.strip
  when nil, '', '*'
    ALL
  else
    Select.new(selectstr, model)
  end
end

Instance Method Details

#all_props?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/odata/select.rb', line 26

def all_props?
  false
end

#parse_error?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/odata/select.rb', line 34

def parse_error?
  Contract::OK
end