Class: FixtureFox::Anchor

Inherits:
Object
  • Object
show all
Defined in:
lib/fixture_fox/anchor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type, id: nil) ⇒ Anchor

Returns a new instance of Anchor.



8
9
10
11
12
13
# File 'lib/fixture_fox/anchor.rb', line 8

def initialize(name, type, id: nil)
  constrain name, Symbol
  constrain type, PgGraph::Type::RecordType
  constrain id, NilClass, Integer
  @name, @type, @id = name, type, id
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/fixture_fox/anchor.rb', line 6

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/fixture_fox/anchor.rb', line 4

def name
  @name
end

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/fixture_fox/anchor.rb', line 5

def type
  @type
end

Instance Method Details

#table_uidObject



16
# File 'lib/fixture_fox/anchor.rb', line 16

def table_uid() type.table.uid end

#uidObject



15
# File 'lib/fixture_fox/anchor.rb', line 15

def uid() @uid ||= "#{table_uid}[#{id}]" end