lib/vedeu/dsl/attributes.rb in vedeu-0.8.0 vs lib/vedeu/dsl/attributes.rb in vedeu-0.8.1

- old
+ new

@@ -1,5 +1,7 @@ +# frozen_string_literal: true + module Vedeu module DSL # Creates attributes for DSL objects. @@ -12,11 +14,11 @@ # @param (see #initialize) # @return (see #attributes) def self.build(context = nil, model = nil, - value = ''.freeze, + value = '', options = {}, &block) new(context, model, value, options, &block).attributes end @@ -40,16 +42,16 @@ # @option options wordwrap [Boolean] Whether the value should be # wordwrapped. # @return [Vedeu::DSL::Attributes] def initialize(context = nil, model = nil, - value = ''.freeze, + value = '', options = {}, &block) @context = context @model = model - @value = value || ''.freeze + @value = value || '' @options = options || {} @block = block end # @return [Hash] @@ -116,11 +118,11 @@ { align: :none, client: nil, colour: nil, name: nil, - pad: ' '.freeze, + pad: ' ', style: nil, truncate: false, width: nil, wordwrap: false, } @@ -143,10 +145,10 @@ defaults.merge!(@options) end # @return [String] def pad - options[:pad].to_s[0] || ' '.freeze + options[:pad].to_s[0] || ' ' end # @return [NilClass|Vedeu::Presentation::Style] def style Vedeu::Presentation::Style.coerce(options[:style])