Module: Cuprum::Collections::Relation::Cardinality

Included in:
Cuprum::Collections::Resource
Defined in:
lib/cuprum/collections/relation.rb

Overview

Methods for resolving a singular or plural relation.

Instance Method Summary collapse

Instance Method Details

#plural?Boolean

Returns true if the relation is plural; otherwise false.

Returns:

  • (Boolean)

    true if the relation is plural; otherwise false.



13
14
15
# File 'lib/cuprum/collections/relation.rb', line 13

def plural?
  @plural
end

#singular?Boolean

Returns true if the relation is singular; otherwise false.

Returns:

  • (Boolean)

    true if the relation is singular; otherwise false.



18
19
20
# File 'lib/cuprum/collections/relation.rb', line 18

def singular?
  !@plural
end