Sha256: ac2953782ea528b3c0cf357bfbfffe05e82be1a972df074acf46c5fd142932c1

Contents?: true

Size: 779 Bytes

Versions: 106

Compression:

Stored size: 779 Bytes

Contents

class EntityCard

  attr_accessor :entity
  attr_accessor :name, :long_name, :description, :meta
  attr_accessor :list_container, :action_controller
  attr_accessor :sections

  def initialize(entity)
    @entity = entity
  end


  def sections
    @sections ||= IndiferentHash.setup({})
  end

  def add_section(name, &block)
    sections[name] = block
  end

  %w(name long_name description meta).each do |method|
    self.send(:define_method, method.to_sym) do |&block|
      if block
        instance_variable_set("@#{method}", block)
      else
        instance_variable_get("@#{method}")
      end
    end
  end
end

module EntityRESTHelpers
  def entity_card_render(card,&block)
    partial_render('entity_partials/entity_card', :card => card, :block => block)
  end
end

Version data entries

106 entries across 106 versions & 1 rubygems

Version Path
rbbt-rest-1.8.136 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.135 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.134 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.133 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.132 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.131 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.130 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.129 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.126 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.123 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.122 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.121 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.120 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.119 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.118 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.117 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.116 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.115 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.114 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.113 lib/rbbt/rest/entity/entity_card.rb