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.9.1 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.9.0 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.157 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.156 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.155 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.154 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.152 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.151 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.150 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.148 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.147 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.146 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.145 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.144 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.143 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.142 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.140 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.139 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.138 lib/rbbt/rest/entity/entity_card.rb
rbbt-rest-1.8.137 lib/rbbt/rest/entity/entity_card.rb