Class: AdminAssistant::PaperclipColumn

Inherits:
Column
  • Object
show all
Defined in:
lib/admin_assistant/paperclip_column.rb

Defined Under Namespace

Classes: FormView, IndexView, ShowView, View

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Column

#form_view, #index_view, #search_view, #show_view, #verify_for_search, #view

Constructor Details

#initialize(name) ⇒ PaperclipColumn

Returns a new instance of PaperclipColumn.



5
6
7
# File 'lib/admin_assistant/paperclip_column.rb', line 5

def initialize(name)
  @name = name.to_s
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/admin_assistant/paperclip_column.rb', line 3

def name
  @name
end

Instance Method Details

#contains?(column_name) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
12
13
# File 'lib/admin_assistant/paperclip_column.rb', line 9

def contains?(column_name)
  column_name.to_s == @name ||
  column_name.to_s =~
      /^#{@name}_(file_name|content_type|file_size|updated_at)$/
end