Class: OData::Association

Inherits:
Object
  • Object
show all
Defined in:
lib/odata/association.rb,
lib/odata/association/end.rb,
lib/odata/association/proxy.rb

Defined Under Namespace

Classes: End, Proxy

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Association

Returns a new instance of Association.

Raises:

  • (ArgumentError)


8
9
10
11
12
13
14
# File 'lib/odata/association.rb', line 8

def initialize(options)
  @name = options[:name]
  @ends = options[:ends] || []

  raise ArgumentError, 'name must be provided' if name.nil? || name == ''
  raise ArgumentError, 'too many association ends' if ends.size > 2
end

Instance Attribute Details

#endsObject (readonly)

Returns the value of attribute ends.



6
7
8
# File 'lib/odata/association.rb', line 6

def ends
  @ends
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/odata/association.rb', line 6

def name
  @name
end