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.



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

def initialize(authorise, model, options)
  @authorise = authorise
  @model = model
  @options = options
end

Instance Attribute Details

#authoriseObject (readonly)

Returns the value of attribute authorise.



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

def authorise
  @authorise
end

#modelObject (readonly)

Returns the value of attribute model.



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

def model
  @model
end

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

Instance Method Details

#dataObject



24
25
26
# File 'lib/type_station/blocks/base.rb', line 24

def data
  {}
end

#render(content) ⇒ Object



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

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