Sha256: f3158960ac8889970a86eab9365c16a678463a9e45e4882276e2c665e241c3b7

Contents?: true

Size: 704 Bytes

Versions: 6

Compression:

Stored size: 704 Bytes

Contents

module CSL
  class Style

    class Text < Node
      attr_struct :variable, :macro, :term, :form, :plural, :value,
        *Schema.attr(:formatting, :display, :quotes, :periods)

      has_no_children

			def has_variable?
				attribute?(:variable)
			end

			def variable
				attributes[:variable]
			end
			
			def variable_options
				attributes_for :form
			end

			def has_macro?
				attribute?(:macro)
			end

			# @return [Macro, nil]
			def macro
				raise unless parent.respond_to?(:macros)
				parent.macros[attributes[:macro]]
			end

			def has_term?
				attribute?(:term)
			end

			def has_value?
				attribute?(:value)
			end

			def value
				attributes[:value]
			end
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
csl-1.0.0.pre21 lib/csl/style/text.rb
csl-1.0.0.pre20 lib/csl/style/text.rb
csl-1.0.0.pre19 lib/csl/style/text.rb
csl-1.0.0.pre18 lib/csl/style/text.rb
csl-1.0.0.pre17 lib/csl/style/text.rb
csl-1.0.0.pre16 lib/csl/style/text.rb