Sha256: eebcd0b80697c4f5c3f980378b4a1c64226f8290c16ab366d6979256d6934a38

Contents?: true

Size: 928 Bytes

Versions: 1

Compression:

Stored size: 928 Bytes

Contents

class Dummy
  attr_reader :name
  include RubyLess::SafeClass
  
  safe_method [:ancestor?, Dummy]  => RubyLess::Boolean
  safe_method :parent              => {:class => 'Dummy', :special_option => 'foobar'}
  safe_method :children            => ['Dummy']
  safe_method :project             => 'Dummy'
  safe_method :spouse              => {:class => 'Dummy', :nil => true}
  safe_method :husband             => {:class => 'Dummy', :nil => true}
  safe_method :id                  => {:class => RubyLess::Number, :method => :zip}
  safe_method :name                => String
  
  def initialize(name = 'dummy')
    @name = name
  end
  
  # This method returns pseudo-nil and does not need to be declared with :nil => true
  def project
    Dummy.new('project')
  end
  
  # This method can return nil and must be declared with :nil => true
  def spouse
    nil
  end
  
  def husband
    nil
  end
  
  def zip
    10
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubyless-0.1.0 test/mock/dummy_class.rb