Sha256: 6658464052e46832434180000b3e5b44e0fd05042ca0f13c65edccdc4a444f42

Contents?: true

Size: 502 Bytes

Versions: 6

Compression:

Stored size: 502 Bytes

Contents

class Tramway::Landing::BlockDecorator < ::Tramway::Core::ApplicationDecorator
  class << self
    def collections
      [ :all ]
    end

    def list_attributes
      [ :position, :view_state, :block_type ]
    end
  end

  delegate :position, to: :object

  def block_type
    object.block_type_text
  end

  def view_state
    object.human_view_state_name
  end

  def view_state_button_color(event)
    case event
    when :publish
      :primary
    when :hide
      :secondary
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tramway-landing-1.2.7 app/decorators/tramway/landing/block_decorator.rb
tramway-landing-1.2.6 app/decorators/tramway/landing/block_decorator.rb
tramway-landing-1.2.5 app/decorators/tramway/landing/block_decorator.rb
tramway-landing-1.2.4 app/decorators/tramway/landing/block_decorator.rb
tramway-landing-1.2.3 app/decorators/tramway/landing/block_decorator.rb
tramway-landing-1.2.2 app/decorators/tramway/landing/block_decorator.rb