Class: TypeStation::Blocks::Base

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers::TagHelper
Defined in:
lib/type_station/blocks/base.rb

Direct Known Subclasses

Entity, Field

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(authorise, model, options) ⇒ Base

Returns a new instance of Base.



11
12
13
14
15
16
# File 'lib/type_station/blocks/base.rb', line 11

def initialize(authorise, model, options)
  @sanitizer = Rails::Html::WhiteListSanitizer.new
  @authorise = authorise
  @model = model
  @options = options
end

Instance Attribute Details

#authoriseObject (readonly)

Returns the value of attribute authorise.



9
10
11
# File 'lib/type_station/blocks/base.rb', line 9

def authorise
  @authorise
end

#modelObject (readonly)

Returns the value of attribute model.



9
10
11
# File 'lib/type_station/blocks/base.rb', line 9

def model
  @model
end

#optionsObject (readonly)

Returns the value of attribute options.



9
10
11
# File 'lib/type_station/blocks/base.rb', line 9

def options
  @options
end

Instance Method Details

#dataObject



26
27
28
# File 'lib/type_station/blocks/base.rb', line 26

def data
  {}
end

#render(content) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/type_station/blocks/base.rb', line 18

def render(content)
  if showifblock
    render_edit(content)
  else
    render_default(content)
  end
end