Class: Moblues::DataModel::Relationship

Inherits:
Struct
  • Object
show all
Defined in:
lib/moblues/data_model/relationship.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Relationship

Returns a new instance of Relationship.



6
7
8
9
10
11
12
13
14
# File 'lib/moblues/data_model/relationship.rb', line 6

def initialize(params)
  p = params.compact
  super(
    p.fetch(:name),
    p.fetch(:destination_entity),
    p.fetch(:to_many, false),
    p.fetch(:ordered, false)
  )
end

Instance Attribute Details

#destination_entityObject

Returns the value of attribute destination_entity

Returns:

  • (Object)

    the current value of destination_entity



5
6
7
# File 'lib/moblues/data_model/relationship.rb', line 5

def destination_entity
  @destination_entity
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



5
6
7
# File 'lib/moblues/data_model/relationship.rb', line 5

def name
  @name
end

#orderedObject

Returns the value of attribute ordered

Returns:

  • (Object)

    the current value of ordered



5
6
7
# File 'lib/moblues/data_model/relationship.rb', line 5

def ordered
  @ordered
end

#to_manyObject

Returns the value of attribute to_many

Returns:

  • (Object)

    the current value of to_many



5
6
7
# File 'lib/moblues/data_model/relationship.rb', line 5

def to_many
  @to_many
end