Sha256: d9ab22fc98413c4d578825f63f7aa342ffeb92bc8e036f6983d241f1ac48ca5e

Contents?: true

Size: 1.05 KB

Versions: 20

Compression:

Stored size: 1.05 KB

Contents

module Bhf::Platform::Attribute
  class Abstract

    attr_reader :name, :title, :info

    def initialize(options)
      @name = options[:name]
      @title = options[:title]
      @info = options[:info]

      @options_form_type = options[:form_type].to_sym if options[:form_type]
      @options_display_type = options[:display_type].to_sym if options[:display_type]
      @options_show_type = options[:show_type].to_sym if options[:show_type]

      @link_platform_settings = options[:link] unless options[:link].blank?
    end

    def macro
      :column
    end

    def form_type
      @options_form_type || @name
    end

    def display_type
      @options_display_type || @name
    end

    def type_ignore_emtpy?
      false
    end

    def show_type
      @options_show_type || display_type || @name
    end

    def link
      return unless @link_platform_settings
      @link ||= Bhf::Platform::Base.new(@link_platform_settings)
    end

    def reflection
      false
    end

    def db_name
      name
    end

    def reorderble
      false
    end

  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
bhf-1.0.0.beta16 lib/bhf/platform/attribute/abstract.rb
bhf-1.0.0.beta15 lib/bhf/platform/attribute/abstract.rb
bhf-1.0.0.beta14 lib/bhf/platform/attribute/abstract.rb
bhf-1.0.0.beta13 lib/bhf/platform/attribute/abstract.rb
bhf-1.0.0.beta12 lib/bhf/platform/attribute/abstract.rb
bhf-1.0.0.beta11 lib/bhf/platform/attribute/abstract.rb
bhf-1.0.0.beta10 lib/bhf/platform/attribute/abstract.rb
bhf-1.0.0.beta9 lib/bhf/platform/attribute/abstract.rb
bhf-1.0.0.beta8 lib/bhf/platform/attribute/abstract.rb
bhf-1.0.0.beta7 lib/bhf/platform/attribute/abstract.rb
bhf-1.0.0.beta6 lib/bhf/platform/attribute/abstract.rb
bhf-1.0.0.beta5 lib/bhf/platform/attribute/abstract.rb
bhf-1.0.0.beta4 lib/bhf/platform/attribute/abstract.rb
bhf-1.0.0.beta3 lib/bhf/platform/attribute/abstract.rb
bhf-1.0.0.beta2 lib/bhf/platform/attribute/abstract.rb
bhf-1.0.0.beta1 lib/bhf/platform/attribute/abstract.rb
bhf-0.10.17 lib/bhf/platform/attribute/abstract.rb
bhf-0.10.16 lib/bhf/platform/attribute/abstract.rb
bhf-0.10.15 lib/bhf/platform/attribute/abstract.rb
bhf-0.10.14 lib/bhf/platform/attribute/abstract.rb