Class: FeedMe::Parser

Inherits:
FeedData show all
Defined in:
lib/feedme.rb

Instance Attribute Summary collapse

Attributes inherited from FeedData

#fm_builder, #fm_parent

Instance Method Summary collapse

Methods inherited from FeedData

#[], #[]=, #call_virtual_method, #each, #each_with_index, #id, #key?, #keys, #method_missing, #size, #to_indented_s, #to_s

Constructor Details

#initialize(builder, source, options = {}) ⇒ Parser

Returns a new instance of Parser.



499
500
501
502
503
504
505
506
# File 'lib/feedme.rb', line 499

def initialize(builder, source, options={})
   super(nil, nil, builder)
	@fm_source = source.respond_to?(:read) ? source.read : source.to_s
   @fm_options = Hash.new.update(options)
   @fm_parsed = []
   @fm_unparsed = []
	parse
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class FeedMe::FeedData

Instance Attribute Details

#fm_optionsObject (readonly)

Returns the value of attribute fm_options.



497
498
499
# File 'lib/feedme.rb', line 497

def fm_options
  @fm_options
end

#fm_sourceObject (readonly)

Returns the value of attribute fm_source.



497
498
499
# File 'lib/feedme.rb', line 497

def fm_source
  @fm_source
end

#fm_tagsObject (readonly)

Returns the value of attribute fm_tags.



497
498
499
# File 'lib/feedme.rb', line 497

def fm_tags
  @fm_tags
end

#fm_typeObject (readonly)

Returns the value of attribute fm_type.



497
498
499
# File 'lib/feedme.rb', line 497

def fm_type
  @fm_type
end

#fm_unparsedObject (readonly)

Returns the value of attribute fm_unparsed.



497
498
499
# File 'lib/feedme.rb', line 497

def fm_unparsed
  @fm_unparsed
end

Instance Method Details

#channelObject Also known as: feed



508
# File 'lib/feedme.rb', line 508

def channel() self end

#fm_prefixObject



515
516
517
# File 'lib/feedme.rb', line 515

def fm_prefix
  fm_type.to_s.downcase
end

#fm_tag_nameObject



511
512
513
# File 'lib/feedme.rb', line 511

def fm_tag_name
  @fm_type == FeedMe::ATOM ? 'feed' : 'channel'
end