Class: Card::Set::All::NestEditor::NestParser
- Inherits:
-
Object
- Object
- Card::Set::All::NestEditor::NestParser
- Defined in:
- tmpsets/set/mod023-edit/all/nest_editor/nest_parser.rb
Overview
from a nest syntax string
Instance Attribute Summary collapse
-
#item_options ⇒ Object
readonly
Returns the value of attribute item_options.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Class Method Summary collapse
Instance Method Summary collapse
- #field? ⇒ Boolean
-
#initialize(nest_string, _default_view, default_item_view) ⇒ NestParser
constructor
A new instance of NestParser.
Constructor Details
#initialize(nest_string, _default_view, default_item_view) ⇒ NestParser
Returns a new instance of NestParser.
26 27 28 29 30 31 32 33 |
# File 'tmpsets/set/mod023-edit/all/nest_editor/nest_parser.rb', line 26 def initialize nest_string, _default_view, default_item_view @raw = nest_string @default_item_view = default_item_view nest = Card::Content::Chunk::Nest.new nest_string, nil init_name nest.name nest. @options = nest. end |
Instance Attribute Details
#item_options ⇒ Object (readonly)
Returns the value of attribute item_options.
12 13 14 |
# File 'tmpsets/set/mod023-edit/all/nest_editor/nest_parser.rb', line 12 def @item_options end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'tmpsets/set/mod023-edit/all/nest_editor/nest_parser.rb', line 12 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
12 13 14 |
# File 'tmpsets/set/mod023-edit/all/nest_editor/nest_parser.rb', line 12 def @options end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
12 13 14 |
# File 'tmpsets/set/mod023-edit/all/nest_editor/nest_parser.rb', line 12 def raw @raw end |
Class Method Details
.new(nest_string, default_view, default_item_view) ⇒ Object
14 15 16 17 18 19 20 |
# File 'tmpsets/set/mod023-edit/all/nest_editor/nest_parser.rb', line 14 def self.new nest_string, default_view, default_item_view return super if nest_string.is_a? String OpenStruct.new(name: "", field?: true, options: [[:view, default_view]], item_options: [], raw: "{{+|view: #{default_view}}}") end |
Instance Method Details
#field? ⇒ Boolean
22 23 24 |
# File 'tmpsets/set/mod023-edit/all/nest_editor/nest_parser.rb', line 22 def field? @field end |