Class: Bhf::Platform::Attribute::Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/bhf/platform/attribute/abstract.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Abstract

Returns a new instance of Abstract.



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/bhf/platform/attribute/abstract.rb', line 6

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

Instance Attribute Details

#infoObject (readonly)

Returns the value of attribute info.



4
5
6
# File 'lib/bhf/platform/attribute/abstract.rb', line 4

def info
  @info
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/bhf/platform/attribute/abstract.rb', line 4

def name
  @name
end

#titleObject (readonly)

Returns the value of attribute title.



4
5
6
# File 'lib/bhf/platform/attribute/abstract.rb', line 4

def title
  @title
end

Instance Method Details

#db_nameObject



47
48
49
# File 'lib/bhf/platform/attribute/abstract.rb', line 47

def db_name
  name
end

#display_typeObject



26
27
28
# File 'lib/bhf/platform/attribute/abstract.rb', line 26

def display_type
  @options_display_type || @name
end

#form_typeObject



22
23
24
# File 'lib/bhf/platform/attribute/abstract.rb', line 22

def form_type
  @options_form_type || @name
end


38
39
40
41
# File 'lib/bhf/platform/attribute/abstract.rb', line 38

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

#macroObject



18
19
20
# File 'lib/bhf/platform/attribute/abstract.rb', line 18

def macro
  :column
end

#reflectionObject



43
44
45
# File 'lib/bhf/platform/attribute/abstract.rb', line 43

def reflection
  false
end

#reorderbleObject



51
52
53
# File 'lib/bhf/platform/attribute/abstract.rb', line 51

def reorderble
  false
end

#show_typeObject



34
35
36
# File 'lib/bhf/platform/attribute/abstract.rb', line 34

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

#type_ignore_emtpy?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/bhf/platform/attribute/abstract.rb', line 30

def type_ignore_emtpy?
  false
end