Class: OData::Association::End
- Inherits:
-
Object
- Object
- OData::Association::End
- Defined in:
- lib/odata/association/end.rb
Instance Attribute Summary collapse
-
#entity_type ⇒ Object
readonly
Returns the value of attribute entity_type.
-
#multiplicity ⇒ Object
readonly
Returns the value of attribute multiplicity.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ End
constructor
A new instance of End.
Constructor Details
#initialize(options) ⇒ End
Returns a new instance of End.
6 7 8 9 10 11 12 13 |
# File 'lib/odata/association/end.rb', line 6 def initialize() @entity_type = [:entity_type] @multiplicity = self.class.multiplicity_map[[:multiplicity].to_s] raise ArgumentError, ':entity_type option is required' if entity_type.nil? || entity_type == '' raise ArgumentError, ':multiplicity option is required' if multiplicity.nil? raise ArgumentError, ':multiplicity option must be one of [1, *, 0..1]' unless valid_multiplicities.include?(multiplicity) end |
Instance Attribute Details
#entity_type ⇒ Object (readonly)
Returns the value of attribute entity_type.
4 5 6 |
# File 'lib/odata/association/end.rb', line 4 def entity_type @entity_type end |
#multiplicity ⇒ Object (readonly)
Returns the value of attribute multiplicity.
4 5 6 |
# File 'lib/odata/association/end.rb', line 4 def multiplicity @multiplicity end |
Class Method Details
.multiplicity_map ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/odata/association/end.rb', line 15 def self.multiplicity_map { '1' => :one, '*' => :many, '0..1' => :zero_to_one } end |