Class: TypeStation::Blocks::Base
- Inherits:
-
Object
- Object
- TypeStation::Blocks::Base
- Includes:
- ActionView::Helpers::TagHelper
- Defined in:
- lib/type_station/blocks/base.rb
Instance Attribute Summary collapse
-
#authorise ⇒ Object
readonly
Returns the value of attribute authorise.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(authorise, model, options) ⇒ Base
constructor
A new instance of Base.
- #render(content) ⇒ Object
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(, model, ) @sanitizer = Rails::Html::WhiteListSanitizer.new @authorise = @model = model @options = end |
Instance Attribute Details
#authorise ⇒ Object (readonly)
Returns the value of attribute authorise.
9 10 11 |
# File 'lib/type_station/blocks/base.rb', line 9 def @authorise end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
9 10 11 |
# File 'lib/type_station/blocks/base.rb', line 9 def model @model end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/type_station/blocks/base.rb', line 9 def @options end |
Instance Method Details
#data ⇒ Object
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 |