Class: Plist::PTag

Inherits:
Object
  • Object
show all
Defined in:
lib/plist/parser.rb

Direct Known Subclasses

PArray, PData, PDate, PDict, PFalse, PInteger, PKey, PList, PReal, PString, PTrue

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ PTag

Returns a new instance of PTag.



164
165
166
167
# File 'lib/plist/parser.rb', line 164

def initialize(options)
  @children = []
  @options = options
end

Instance Attribute Details

#childrenObject

Returns the value of attribute children.



163
164
165
# File 'lib/plist/parser.rb', line 163

def children
  @children
end

#optionsObject

Returns the value of attribute options.



163
164
165
# File 'lib/plist/parser.rb', line 163

def options
  @options
end

#textObject

Returns the value of attribute text.



163
164
165
# File 'lib/plist/parser.rb', line 163

def text
  @text
end

Class Method Details

.inherited(sub_class) ⇒ Object



155
156
157
158
159
160
161
# File 'lib/plist/parser.rb', line 155

def self.inherited(sub_class)
  key = sub_class.to_s.downcase
  key.gsub!(/^plist::/, '')
  key.gsub!(/^p/, '')  unless key == "plist"

  mappings[key] = sub_class
end

.mappingsObject



151
152
153
# File 'lib/plist/parser.rb', line 151

def self.mappings
  @mappings ||= {}
end

Instance Method Details

#to_rubyObject



169
170
171
# File 'lib/plist/parser.rb', line 169

def to_ruby
  raise "Unimplemented: " + self.class.to_s + "#to_ruby on #{self.inspect}"
end