Class: Admino::Table::Row

Inherits:
Object
  • Object
show all
Defined in:
lib/admino/table/row.rb

Direct Known Subclasses

HeadRow, ResourceRow

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(view_context) ⇒ Row

Returns a new instance of Row.



8
9
10
# File 'lib/admino/table/row.rb', line 8

def initialize(view_context)
  @view_context = view_context
end

Instance Attribute Details

#view_contextObject (readonly) Also known as: h

Returns the value of attribute view_context.



4
5
6
# File 'lib/admino/table/row.rb', line 4

def view_context
  @view_context
end

Instance Method Details

#parse_action_args(args) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/admino/table/row.rb', line 30

def parse_action_args(args)
  html_options = args.extract_options!

  action_name = if args.first.is_a?(Symbol)
                  args.shift
                else
                  nil
                end

  url = if args.first.is_a?(String)
            args.shift
          else
            nil
          end

  label = args.shift

  [action_name, url, label, html_options]
end

#parse_column_args(args) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/admino/table/row.rb', line 12

def parse_column_args(args)
  html_options = args.extract_options!

  attribute_name = if args.first.is_a?(Symbol)
                     args.shift
                   else
                     nil
                   end

  label = if args.first.is_a?(String) || args.first.is_a?(Symbol)
            args.shift
          else
            nil
          end

  [attribute_name, label, html_options]
end

#to_htmlObject



50
51
52
# File 'lib/admino/table/row.rb', line 50

def to_html
  nil
end