lib/kitchen/exercise_element.rb
# Creates a new +ExerciseElement+
#
# @param node [Nokogiri::XML::Node] the node this element wraps
# @param document [Document] this element's document
#
Creates a new +ExerciseElement+
Creates a new + ExerciseElement +
def detected_exercise_title_key
      @detected_exercise_title_key ||= begin
        return 0 if classes.empty? || !I18n.t('.').key?(:exercises)
        possible_keys = I18n.t(:exercises).keys.map(&:to_s)
        keys = possible_keys & classes
        raise("too many translation keys: #{keys.join(', ')}") if keys.many?
        return 0 if keys.empty?
        keys.first
      end
    end
def detected_exercise_title_key @detected_exercise_title_key ||= begin return 0 if classes . empty? || ! I18n . t ( '.' ) . key? ( :exercises ) possible_keys = I18n . t ( :exercises ) . keys . map ( & :to_s ) keys = possible_keys & classes raise ( "too many translation keys: #{keys.join(', ')}" ) if keys . many? return 0 if keys . empty? keys . first end end
Creates a new +ExerciseElement+
Creates a new + ExerciseElement +
node
<not_specific>
the node this element wraps
the node this element wraps
document
<not_specific>
this element's document
this element ' s document