Class: Peregrin::Property

Inherits:
Object
  • Object
show all
Defined in:
lib/peregrin/property.rb

Overview

Books have metadata. Each unit of metadata (each metadatum?) is a ‘property’ of the book.

A property has a key, a value and an optional set of attributes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, value, attributes = {}) ⇒ Property

Returns a new instance of Property.



10
11
12
13
14
# File 'lib/peregrin/property.rb', line 10

def initialize(key, value, attributes = {})
  @key = key
  @value = value
  @attributes = attributes
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



8
9
10
# File 'lib/peregrin/property.rb', line 8

def attributes
  @attributes
end

#keyObject

Returns the value of attribute key.



8
9
10
# File 'lib/peregrin/property.rb', line 8

def key
  @key
end

#valueObject

Returns the value of attribute value.



8
9
10
# File 'lib/peregrin/property.rb', line 8

def value
  @value
end