Class: OData::AbstractQuery::Segments::EntityTypeSegment
Instance Attribute Summary collapse
#query, #value
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Countable
included
#can_follow?, #inspect, parse!, segment_name
Constructor Details
#initialize(query, entity_type, value = nil) ⇒ EntityTypeSegment
9
10
11
12
13
|
# File 'lib/o_data/abstract_query/segments/entity_type_segment.rb', line 9
def initialize(query, entity_type, value = nil)
@entity_type = entity_type
super(query, value || (@entity_type.is_a?(OData::AbstractSchema::EntityType) ? @entity_type.plural_name : @entity_type))
end
|
Instance Attribute Details
#entity_type ⇒ Object
Returns the value of attribute entity_type.
7
8
9
|
# File 'lib/o_data/abstract_query/segments/entity_type_segment.rb', line 7
def entity_type
@entity_type
end
|
Class Method Details
.can_follow?(anOtherSegment) ⇒ Boolean
15
16
17
|
# File 'lib/o_data/abstract_query/segments/entity_type_segment.rb', line 15
def self.can_follow?(anOtherSegment)
false
end
|
Instance Method Details
#execute!(acc) ⇒ Object
19
20
21
22
23
|
# File 'lib/o_data/abstract_query/segments/entity_type_segment.rb', line 19
def execute!(acc)
return [] if @entity_type.blank?
@entity_type.find_all
end
|
#valid?(results) ⇒ Boolean
25
26
27
|
# File 'lib/o_data/abstract_query/segments/entity_type_segment.rb', line 25
def valid?(results)
countable? ? results.is_a?(Array) : !results.blank?
end
|