Sha256: 56c6069b67d8e5709ca7cddadb576c06e926b3dc65ef805db6eb44fc71518ec4

Contents?: true

Size: 273 Bytes

Versions: 33

Compression:

Stored size: 273 Bytes

Contents

class Author
  attr_accessor :id
  attr_accessor :name

  def initialize(options={})
    self.id = options[:id] || 1
    self.name = options[:name] || 'Nobody'
  end

  # needed for field= to work
  def [](idx)
    send(idx)
  end

  def url
    "/authors/#{id}"
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
dryml-2.2.6 features/support/models/author.rb
dryml-2.2.5 features/support/models/author.rb
dryml-2.2.4 features/support/models/author.rb
dryml-2.2.3 features/support/models/author.rb
dryml-2.2.2 features/support/models/author.rb
dryml-2.2.1 features/support/models/author.rb
dryml-2.2.0 features/support/models/author.rb
dryml-2.1.2 features/support/models/author.rb
dryml-2.1.1 features/support/models/author.rb
dryml-2.1.0 features/support/models/author.rb
dryml-2.1.0.pre4 features/support/models/author.rb
dryml-2.1.0.pre3 features/support/models/author.rb
dryml-2.1.0.pre2 features/support/models/author.rb
dryml-2.1.0.pre1 features/support/models/author.rb
dryml-2.0.1 features/support/models/author.rb
dryml-2.0.0 features/support/models/author.rb
dryml-2.0.0.pre10 features/support/models/author.rb
dryml-2.0.0.pre9 features/support/models/author.rb
dryml-2.0.0.pre8 features/support/models/author.rb
dryml-2.0.0.pre7 features/support/models/author.rb