Sha256: 35c09cb0ce5d0a3f395a8b2d596d4493a0a65eb3ac63fb36e403661d0a8441f8

Contents?: true

Size: 651 Bytes

Versions: 12

Compression:

Stored size: 651 Bytes

Contents

module EfoNelfo
  module PostHeadType

    def self.included(base)
      base.send :property, :post_type,  alias: :PostType,      limit: 2, default: base.post_type
      base.send :property, :format,     alias: :Format,        limit: 8, default: 'EFONELFO'
      base.send :property, :version,    alias: :Versjon,       limit: 3, default: base.version
    end

    def [](index)
      lines[index]
    end

    def add(post_type)
      if has_association? post_type
        find_association(post_type) << post_type
      else
        if lines.any?
          lines.last.find_association(post_type) << post_type
        end
      end
    end

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
efo_nelfo-2.0.0 lib/efo_nelfo/post_head_type.rb
efo_nelfo-1.7.0 lib/efo_nelfo/post_head_type.rb
efo_nelfo-1.6.2 lib/efo_nelfo/post_head_type.rb
efo_nelfo-1.6.1 lib/efo_nelfo/post_head_type.rb
efo_nelfo-1.6.0 lib/efo_nelfo/post_head_type.rb
efo_nelfo-1.5.5 lib/efo_nelfo/post_head_type.rb
efo_nelfo-1.5.4 lib/efo_nelfo/post_head_type.rb
efo_nelfo-1.5.3 lib/efo_nelfo/post_head_type.rb
efo_nelfo-1.5.2 lib/efo_nelfo/post_head_type.rb
efo_nelfo-1.5.1 lib/efo_nelfo/post_head_type.rb
efo_nelfo-1.5.0 lib/efo_nelfo/post_head_type.rb
efo_nelfo-1.4.0 lib/efo_nelfo/post_head_type.rb