Class: Ahnnotate::Index

Inherits:
Object
  • Object
show all
Defined in:
lib/ahnnotate/index.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Index

Returns a new instance of Index.



8
9
10
11
12
# File 'lib/ahnnotate/index.rb', line 8

def initialize(**args)
  args.each do |key, value|
    public_send("#{key}=", value)
  end
end

Instance Attribute Details

#columnsObject

Returns the value of attribute columns.



4
5
6
# File 'lib/ahnnotate/index.rb', line 4

def columns
  @columns
end

#commentObject

Returns the value of attribute comment.



5
6
7
# File 'lib/ahnnotate/index.rb', line 5

def comment
  @comment
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/ahnnotate/index.rb', line 3

def name
  @name
end

#uniqueObject

Returns the value of attribute unique.



6
7
8
# File 'lib/ahnnotate/index.rb', line 6

def unique
  @unique
end

Instance Method Details

#presentable_columnsObject



14
15
16
# File 'lib/ahnnotate/index.rb', line 14

def presentable_columns
  "(#{columns.join(", ")})"
end

#presentable_uniqueObject



18
19
20
21
22
23
24
# File 'lib/ahnnotate/index.rb', line 18

def presentable_unique
  if unique
    "UNIQUE"
  else
    ""
  end
end