Class: FixtureFox::Anchor
- Inherits:
-
Object
- Object
- FixtureFox::Anchor
- Defined in:
- lib/fixture_fox/anchor.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, type, id: nil) ⇒ Anchor
constructor
A new instance of Anchor.
- #table_uid ⇒ Object
- #uid ⇒ Object
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
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/fixture_fox/anchor.rb', line 6 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/fixture_fox/anchor.rb', line 4 def name @name end |
#type ⇒ Object
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_uid ⇒ Object
16 |
# File 'lib/fixture_fox/anchor.rb', line 16 def table_uid() type.table.uid end |
#uid ⇒ Object
15 |
# File 'lib/fixture_fox/anchor.rb', line 15 def uid() @uid ||= "#{table_uid}[#{id}]" end |