Class: ReVIEW::Book::PageMetric

Inherits:
Object
  • Object
show all
Defined in:
lib/review/book/page_metric.rb

Defined Under Namespace

Classes: MetricData

Constant Summary collapse

A5 =
PageMetric.new(46, 80, 30, 74, 1)
B5 =
PageMetric.new(46, 80, 30, 74, 2)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(list_lines, list_columns, text_lines, text_columns, page_per_kbyte) ⇒ PageMetric

Returns a new instance of PageMetric.



18
19
20
21
22
# File 'lib/review/book/page_metric.rb', line 18

def initialize(list_lines, list_columns, text_lines, text_columns, page_per_kbyte)
  @list = MetricData.new(list_lines, list_columns)
  @text = MetricData.new(text_lines, text_columns)
  @page_per_kbyte = page_per_kbyte
end

Instance Attribute Details

#listObject (readonly)

Returns the value of attribute list.



37
38
39
# File 'lib/review/book/page_metric.rb', line 37

def list
  @list
end

#page_per_kbyteObject (readonly)

Returns the value of attribute page_per_kbyte.



39
40
41
# File 'lib/review/book/page_metric.rb', line 39

def page_per_kbyte
  @page_per_kbyte
end

#textObject (readonly)

Returns the value of attribute text.



38
39
40
# File 'lib/review/book/page_metric.rb', line 38

def text
  @text
end

Class Method Details

.a5Object

backward compatible



28
29
30
# File 'lib/review/book/page_metric.rb', line 28

def PageMetric.a5
  ReVIEW::Book::PageMetric::A5
end

.b5Object

backward compatible



33
34
35
# File 'lib/review/book/page_metric.rb', line 33

def PageMetric.b5
  ReVIEW::Book::PageMetric::B5
end

Instance Method Details

#==(other) ⇒ Object



41
42
43
# File 'lib/review/book/page_metric.rb', line 41

def ==(other)
  self.list == other.list && self.text == other.text && self.page_per_kbyte == other.page_per_kbyte
end