Sha256: 00bcae56363bf2bb886e5c5d4e74672cc920ef4f81d00133e851f89558996194

Contents?: true

Size: 1.18 KB

Versions: 15

Compression:

Stored size: 1.18 KB

Contents

module Admino
  module Table
    class Row
      attr_reader :view_context

      alias_method :h, :view_context

      def initialize(view_context)
        @view_context = view_context
      end

      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

      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

      def to_html
        nil
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
admino-0.0.22 lib/admino/table/row.rb
admino-0.0.21 lib/admino/table/row.rb
admino-0.0.20 lib/admino/table/row.rb
admino-0.0.19 lib/admino/table/row.rb
admino-0.0.18 lib/admino/table/row.rb
admino-0.0.17 lib/admino/table/row.rb
admino-0.0.16 lib/admino/table/row.rb
admino-0.0.15 lib/admino/table/row.rb
admino-0.0.14 lib/admino/table/row.rb
admino-0.0.13 lib/admino/table/row.rb
admino-0.0.12 lib/admino/table/row.rb
admino-0.0.11 lib/admino/table/row.rb
admino-0.0.10 lib/admino/table/row.rb
admino-0.0.9 lib/admino/table/row.rb
admino-0.0.8 lib/admino/table/row.rb