Class: ODDB::Text::Format

Inherits:
Object show all
Includes:
OddbYaml
Defined in:
src/model/text.rb,
ext/export/src/oddb_yaml.rb

Constant Summary

EXPORT_PROPERTIES =
[
  '@values',
  '@start',
  '@end',
]

Constants included from OddbYaml

EXPORT_PROPERTIES, YAML_URI

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods included from OddbYaml

#to_yaml_properties, #to_yaml_type

Constructor Details

- (Format) initialize(*args)

A new instance of Format



34
35
36
37
38
# File 'src/model/text.rb', line 34

def initialize(*args)
  @values = args
  @start = 0
  @end = -1
end

Instance Attribute Details

- (Object) end

Returns the value of attribute end



33
34
35
# File 'src/model/text.rb', line 33

def end
  @end
end

- (Object) start

Returns the value of attribute start



33
34
35
# File 'src/model/text.rb', line 33

def start
  @start
end

- (Object) values

Returns the value of attribute values



33
34
35
# File 'src/model/text.rb', line 33

def values
  @values
end

Instance Method Details

- (Boolean) bold?

Returns:

  • (Boolean)


39
40
41
# File 'src/model/text.rb', line 39

def bold?
  @values.include?(:bold)
end

- (Boolean) italic?

Returns:

  • (Boolean)


42
43
44
# File 'src/model/text.rb', line 42

def italic?
  @values.include?(:italic)
end

- (Object) range



51
52
53
# File 'src/model/text.rb', line 51

def range
  @start..@end
end

- (Boolean) subscript?

Returns:

  • (Boolean)


45
46
47
# File 'src/model/text.rb', line 45

def subscript?
  @values.include?(:subscript)
end

- (Boolean) superscript?

Returns:

  • (Boolean)


48
49
50
# File 'src/model/text.rb', line 48

def superscript?
  @values.include?(:superscript)
end

- (Boolean) symbol?

Returns:

  • (Boolean)


54
55
56
# File 'src/model/text.rb', line 54

def symbol?
  @values.include?(:symbol)
end