Sha256: 972676812d14222e7b0cac0f73b543eb264d5d098f45b54b11fc3e5fc46dbe7a

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

# coding: utf-8

module ThinReports
  module Core::Shape
    
    class Tblock::Interface < Basic::Interface
      internal_delegators :format_enabled?
      
      # @param [Boolean] enabled
      # @return [self]
      def format_enabled(enabled)
        internal.format_enabled(enabled)
        self
      end
      
      # @overload value(val)
      #   Set a val
      #   @param [Object] val
      #   @return [self]
      # @overload value
      #   Return the value
      #   @return [Object]
      def value(*args)
        case args.size
        when 0
          internal.read_value
        when 1
          internal.write_value(args.first)
          self
        else
          raise ArgumentError, '#value can take 0 or 1 argument.'
        end
      end
      
      # @param [Object] val
      # @param [Hash<Symbol, Object>] style_settings
      # @return [self]
      def set(val, style_settings = {})
        value(val)
        styles(style_settings) #=> self
      end
    
    private
      
      # @see ThinReports::Core::Shape::Base::Interface#init_internal
      def init_internal(parent, format)
        Tblock::Internal.new(parent, format)
      end
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
thinreports-0.6.0.pre3 lib/thinreports/core/shape/tblock/interface.rb