Class: Safrano::ExpandBase

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

Overview

base class for expanding

Direct Known Subclasses

Expand, MultiExpand

Constant Summary collapse

EmptyExpand =

re-useable empty expanding (idempotent)

new
EMPTYH =
{}.freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.factory(expandstr, model) ⇒ Object



13
14
15
# File 'lib/odata/expand.rb', line 13

def self.factory(expandstr, model)
  expandstr.nil? ? EmptyExpand : MultiExpand.new(expandstr, model)
end

Instance Method Details

#apply_to_dataset(dtcx) ⇒ Object



17
18
19
# File 'lib/odata/expand.rb', line 17

def apply_to_dataset(dtcx)
  Contract.valid(dtcx)
end

#empty?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/odata/expand.rb', line 21

def empty?
  true
end

#parse_error?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/odata/expand.rb', line 25

def parse_error?
  Contract::OK
end

#templateObject



29
30
31
# File 'lib/odata/expand.rb', line 29

def template
  EMPTYH
end