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, #delete, #each, #each_with_index, #id, #key?, #keys, #method_missing, #size, #to_indented_s, #to_s, #transform, #transform_value

Constructor Details

- (Parser) initialize(builder, source, options = {})



580
581
582
583
584
585
586
587
# File 'lib/feedme.rb', line 580

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

- (Object) fm_options (readonly)

Returns the value of attribute fm_options



578
579
580
# File 'lib/feedme.rb', line 578

def fm_options
  @fm_options
end

- (Object) fm_parsed (readonly)

Returns the value of attribute fm_parsed



578
579
580
# File 'lib/feedme.rb', line 578

def fm_parsed
  @fm_parsed
end

- (Object) fm_source (readonly)

Returns the value of attribute fm_source



578
579
580
# File 'lib/feedme.rb', line 578

def fm_source
  @fm_source
end

- (Object) fm_tags (readonly)

Returns the value of attribute fm_tags



578
579
580
# File 'lib/feedme.rb', line 578

def fm_tags
  @fm_tags
end

- (Object) fm_type (readonly)

Returns the value of attribute fm_type



578
579
580
# File 'lib/feedme.rb', line 578

def fm_type
  @fm_type
end

- (Object) fm_unparsed (readonly)

Returns the value of attribute fm_unparsed



578
579
580
# File 'lib/feedme.rb', line 578

def fm_unparsed
  @fm_unparsed
end

Instance Method Details

- (Object) channel Also known as: feed



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

def channel() self end

- (Object) fm_prefix



596
597
598
# File 'lib/feedme.rb', line 596

def fm_prefix
  fm_type.to_s.downcase
end

- (Object) fm_tag_name



592
593
594
# File 'lib/feedme.rb', line 592

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