Class: CML::Tags::Iterate

Inherits:
CML::Tag show all
Defined in:
lib/cml/tags/iterate.rb

Constant Summary collapse

Template =
<<-HTML.freeze
  {{ content }}
HTML

Constants included from CML::TagLogic

CML::TagLogic::And, CML::TagLogic::AndPhraseExp, CML::TagLogic::CombinatorDefault, CML::TagLogic::CombinatorDict, CML::TagLogic::CombinatorExp, CML::TagLogic::GroupExp, CML::TagLogic::Or, CML::TagLogic::OrCombinatorExp, CML::TagLogic::PrecedenceRegexp, CML::TagLogic::TokenExp, CML::TagLogic::TokenRegexp

Instance Attribute Summary

Attributes inherited from CML::Tag

#attrs, #cml, #opts, #tag

Attributes included from CML::TagLogic

#errors, #has_grouped_logic, #has_liquid_logic, #logic_tree

Instance Method Summary collapse

Methods inherited from CML::Tag

#cacheable?, #classes, #convert, #ensure_resolved, #finite_value?, #gold=, #gold?, #gold_class, #gold_reason, #initialize, #instructions, #iterating?, #label, #legend, memoize, #multi_type, #name, #parent_multiples, #prefix, #preloaded_data, #raw_label, #to_html, #to_liquid, #to_s, #validations, #validators, #value, #wrapper

Methods included from CML::TagLogic

#dependencies_on_fields, #dependencies_through_cml_group, #depends_on_fields, #describe_logic_token, #detect_grouped_logic, #detect_liquid_logic, #each_logic_token_in, #expand_logic, #expand_parsed_expression, #keep_merge!, #only_if, parse_expression, resolve_combinator

Constructor Details

This class inherits a constructor from CML::Tag

Instance Method Details

#childrenObject



16
17
18
19
# File 'lib/cml/tags/iterate.rb', line 16

def children
  #Only take the first children because that's how she likes it
  parser.tags
end

#columnsObject



32
33
34
# File 'lib/cml/tags/iterate.rb', line 32

def columns
  @opts[:data].select {|k,v| v.is_a?(Array)}.map {|a| a[0]} rescue []
end

#dataObject



25
26
27
28
29
30
# File 'lib/cml/tags/iterate.rb', line 25

def data
  #this is dangerous because of seg faults...
  super.merge({
    "content" => content
  })
end

#in_logic_graph?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/cml/tags/iterate.rb', line 8

def in_logic_graph?
  false
end

#validate?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/cml/tags/iterate.rb', line 12

def validate?
  false
end

#wrapper_classesObject



21
22
23
# File 'lib/cml/tags/iterate.rb', line 21

def wrapper_classes
  (super + " " + @attrs["class"].to_s).strip
end