Class: Georgia::MenuAncestryParser::LinkAttributes
- Inherits:
-
Object
- Object
- Georgia::MenuAncestryParser::LinkAttributes
- Defined in:
- app/parsers/georgia/menu_ancestry_parser.rb
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(serialized_string) ⇒ LinkAttributes
constructor
A new instance of LinkAttributes.
- #parent_id ⇒ Object
Constructor Details
#initialize(serialized_string) ⇒ LinkAttributes
Returns a new instance of LinkAttributes.
26 27 28 |
# File 'app/parsers/georgia/menu_ancestry_parser.rb', line 26 def initialize serialized_string @serialized_string = serialized_string end |
Instance Method Details
#id ⇒ Object
30 31 32 |
# File 'app/parsers/georgia/menu_ancestry_parser.rb', line 30 def id @serialized_string.split('=')[0][5..-2] end |
#parent_id ⇒ Object
34 35 36 37 |
# File 'app/parsers/georgia/menu_ancestry_parser.rb', line 34 def parent_id parent_id = @serialized_string.split('=')[1] parent_id == 'null' ? nil : parent_id.to_i end |