Class: SimpleFeed::DSL::Activities

Inherits:
Object
  • Object
show all
Includes:
Formatter
Defined in:
lib/simplefeed/dsl/activities.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Formatter

#color_dump, #print_last_read_separator

Methods included from SimpleFeed::DSL

#_puts, debug?, #event, #feed_header, #field, #field_label, #field_value, #header, #hr, #hr_string, #output, #width, #with_activity

Constructor Details

#initialize(activity, **opts) ⇒ Activities

Returns a new instance of Activities.



11
12
13
14
15
16
17
18
19
20
# File 'lib/simplefeed/dsl/activities.rb', line 11

def initialize(activity, **opts)
  self.activity = activity
  self.feed     = activity.feed
  opts.each_pair do |key, value|
    self.class.instance_eval do
      attr_accessor key
    end
    send("#{key}=".to_sym, value)
  end
end

Instance Attribute Details

#activityObject

Returns the value of attribute activity.



9
10
11
# File 'lib/simplefeed/dsl/activities.rb', line 9

def activity
  @activity
end

#feedObject

Returns the value of attribute feed.



9
10
11
# File 'lib/simplefeed/dsl/activities.rb', line 9

def feed
  @feed
end