lib/adaptive_cards/container.rb
def add(item)
      if item.is_a?(AdaptiveCards::Base) &&
         !item.is_a?(AdaptiveCards::AdaptiveCard) &&
         !item.is_a?(AdaptiveCards::Action::Base)
        @items << item
      else
        raise InvalidContentError,
              "#{item.class} is not a valid item for a container"
      end
      self
    end
# Add an item to this container
#
# @param item [AdaptiveCards::Base] the card element to add to this
#   container
# @raise [InvalidContentError] if an invalid element is added
# @return [Container] self, to allow method chaining
Add an item to this container
Add an item to this container
def add(item)
      if item.is_a?(AdaptiveCards::Base) &&
         !item.is_a?(AdaptiveCards::AdaptiveCard) &&
         !item.is_a?(AdaptiveCards::Action::Base)
        @items << item
      else
        raise InvalidContentError,
              "#{item.class} is not a valid item for a container"
      end
      self
    end
def add ( item ) if item . is_a? ( AdaptiveCards :: Base ) && ! item . is_a? ( AdaptiveCards :: AdaptiveCard ) && ! item . is_a? ( AdaptiveCards :: Action :: Base ) @items << item else raise InvalidContentError , "#{item.class} is not a valid item for a container" end self end
Add an item to this container
Add an item to this container
self, to allow method chaining
self to allow method chaining
Container
[InvalidContentError] if an invalid element is added
[ InvalidContentError ] if an invalid element is added
item
the card element to add to this container
the card element to add to this container