Sha256: fe746d0f88655041c814e06403a9f5ee2cf93723007f95284968029304271ab3

Contents?: true

Size: 860 Bytes

Versions: 3

Compression:

Stored size: 860 Bytes

Contents

require 'forwardable'

module Support::V1::Bar
  include SuperModule
  include Support::V1::Foo
  include Comparable
  validates 'bar', {:presence => true}
  attr_reader :created_at

  # Defines singleton methods via class << self to provide as a test case for SuperModule
  class << self
    include Forwardable

    def barrable
      @barrable
    end

    def barrable=(value)
      @barrable = value
    end

    def make_barrable
      self.barrable = true
    end
  end

  make_barrable
  def_delegators :@bar, :length

  def initialize
    @bar = bar
    @created_at = Time.now.to_f
  end

  def bar
    'bar'
  end

  # Defines singleton method via a form of eval (class_eval) to provide as a test case for SuperModule
  class_eval do
    def self.bar
      'self.bar'
    end
  end
  
  def <=>(other)
    created_at <=> other.created_at
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
super_module-1.2.2 spec/support/v1/bar.rb
super_module-1.2.1 spec/support/v1/bar.rb
super_module-1.2.0 spec/support/v1/bar.rb