Class: RRTF::Style
- Inherits:
-
Object
- Object
- RRTF::Style
- Defined in:
- lib/rrtf/style/style.rb
Overview
This is a parent class that all style classes will derive from.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#additive ⇒ Object
Returns the value of attribute additive.
-
#auto_update ⇒ Object
Returns the value of attribute auto_update.
-
#based_on_style_handle ⇒ Object
Returns the value of attribute based_on_style_handle.
-
#handle ⇒ Object
Returns the value of attribute handle.
-
#hidden ⇒ Object
Returns the value of attribute hidden.
-
#name ⇒ Object
Returns the value of attribute name.
-
#next_style_handle ⇒ Object
Returns the value of attribute next_style_handle.
-
#primary ⇒ Object
Returns the value of attribute primary.
-
#priority ⇒ Object
Returns the value of attribute priority.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Style
constructor
Constructor for the style class.
-
#is_character_style? ⇒ Boolean
Used to determine if the style applies to characters.
-
#is_document_style? ⇒ Boolean
Used to determine if the style applies to documents.
-
#is_paragraph_style? ⇒ Boolean
Used to determine if the style applies to paragraphs.
-
#is_table_style? ⇒ Boolean
Used to determine if the style applies to tables.
-
#prefix(document) ⇒ Object
This method retrieves the command prefix text associated with a Style object.
- #rtf_formatting ⇒ Object
-
#styledef ⇒ Object
Constructs an RTF identifier for the style.
- #stylename ⇒ Object
-
#suffix(document) ⇒ Object
This method retrieves the command suffix text associated with a Style object.
-
#to_rtf(document) ⇒ Object
Constructs the RTF formatting representing the style.
Constructor Details
#initialize(options = {}) ⇒ Style
Constructor for the style class.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/rrtf/style/style.rb', line 19 def initialize( = {}) # load default options = { "name" => nil, "handle" => nil, "priority" => nil, "primary" => false, "additive" => false, "next_style_handle" => nil, "auto_update" => false, "based_on_style_handle" => nil, "hidden" => false }.merge() @handle = .delete("handle") @name = .delete("name") @priority = .delete("priority") @flow = .delete("flow") @primary = .delete("primary") @additive = .delete("additive") @next_style_handle = .delete("next_style_handle") @auto_update = .delete("auto_update") @hidden = .delete("hidden") end |
Instance Attribute Details
#additive ⇒ Object
Returns the value of attribute additive.
3 4 5 |
# File 'lib/rrtf/style/style.rb', line 3 def additive @additive end |
#auto_update ⇒ Object
Returns the value of attribute auto_update.
3 4 5 |
# File 'lib/rrtf/style/style.rb', line 3 def auto_update @auto_update end |
#based_on_style_handle ⇒ Object
Returns the value of attribute based_on_style_handle.
3 4 5 |
# File 'lib/rrtf/style/style.rb', line 3 def based_on_style_handle @based_on_style_handle end |
#handle ⇒ Object
Returns the value of attribute handle.
3 4 5 |
# File 'lib/rrtf/style/style.rb', line 3 def handle @handle end |
#hidden ⇒ Object
Returns the value of attribute hidden.
3 4 5 |
# File 'lib/rrtf/style/style.rb', line 3 def hidden @hidden end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/rrtf/style/style.rb', line 3 def name @name end |
#next_style_handle ⇒ Object
Returns the value of attribute next_style_handle.
3 4 5 |
# File 'lib/rrtf/style/style.rb', line 3 def next_style_handle @next_style_handle end |
#primary ⇒ Object
Returns the value of attribute primary.
3 4 5 |
# File 'lib/rrtf/style/style.rb', line 3 def primary @primary end |
#priority ⇒ Object
Returns the value of attribute priority.
3 4 5 |
# File 'lib/rrtf/style/style.rb', line 3 def priority @priority end |
Instance Method Details
#is_character_style? ⇒ Boolean
Used to determine if the style applies to characters. This method always returns false and should be overridden by derived classes as needed.
80 81 82 |
# File 'lib/rrtf/style/style.rb', line 80 def is_character_style? false end |
#is_document_style? ⇒ Boolean
Used to determine if the style applies to documents. This method always returns false and should be overridden by derived classes as needed.
92 93 94 |
# File 'lib/rrtf/style/style.rb', line 92 def is_document_style? false end |
#is_paragraph_style? ⇒ Boolean
Used to determine if the style applies to paragraphs. This method always returns false and should be overridden by derived classes as needed.
86 87 88 |
# File 'lib/rrtf/style/style.rb', line 86 def is_paragraph_style? false end |
#is_table_style? ⇒ Boolean
Used to determine if the style applies to tables. This method always returns false and should be overridden by derived classes as needed.
98 99 100 |
# File 'lib/rrtf/style/style.rb', line 98 def is_table_style? false end |
#prefix(document) ⇒ Object
This method retrieves the command prefix text associated with a Style object. This method always returns nil and should be overridden by derived classes as needed.
63 64 65 |
# File 'lib/rrtf/style/style.rb', line 63 def prefix(document) nil end |
#rtf_formatting ⇒ Object
67 68 69 |
# File 'lib/rrtf/style/style.rb', line 67 def rtf_formatting nil end |
#styledef ⇒ Object
Constructs an RTF identifier for the style. (override in derived classes as needed)
46 47 48 |
# File 'lib/rrtf/style/style.rb', line 46 def styledef nil end |
#stylename ⇒ Object
50 51 52 |
# File 'lib/rrtf/style/style.rb', line 50 def stylename name end |
#suffix(document) ⇒ Object
This method retrieves the command suffix text associated with a Style object. This method always returns nil and should be overridden by derived classes as needed.
74 75 76 |
# File 'lib/rrtf/style/style.rb', line 74 def suffix(document) nil end |
#to_rtf(document) ⇒ Object
Constructs the RTF formatting representing the style. (override in derived classes as needed)
56 57 58 |
# File 'lib/rrtf/style/style.rb', line 56 def to_rtf(document) nil end |