Class: MediumExport
- Inherits:
-
Middleman::Extension
- Object
- Middleman::Extension
- MediumExport
- Defined in:
- lib/middleman-medium_export/extension.rb
Overview
Extension namespace
Defined Under Namespace
Classes: ApiClient, ArticlesFilter, Content, Publisher, Template
Constant Summary collapse
- ApiTokenMissing =
Class.new(ArgumentError)
- InvalidTemplatePosition =
Class.new(ArgumentError)
- InvalidPublishStatus =
Class.new(ArgumentError)
- TEMPLATES_POSSITIONS =
%w[bottom top].freeze
- PUBLISH_STATUSES =
i[public draft unlisted].freeze
Instance Method Summary collapse
- #api_client ⇒ Object
-
#initialize(app, options_hash = {}, &block) ⇒ MediumExport
constructor
A new instance of MediumExport.
- #template ⇒ Object
Constructor Details
#initialize(app, options_hash = {}, &block) ⇒ MediumExport
Returns a new instance of MediumExport.
22 23 24 25 26 27 28 |
# File 'lib/middleman-medium_export/extension.rb', line 22 def initialize(app, ={}, &block) super check_api_token! check_template_positions! check_publish_statuses! end |
Instance Method Details
#api_client ⇒ Object
30 31 32 |
# File 'lib/middleman-medium_export/extension.rb', line 30 def api_client @api_client ||= ApiClient.new(.to_h.slice(:api_token, :publish_status)) end |
#template ⇒ Object
34 35 36 37 38 |
# File 'lib/middleman-medium_export/extension.rb', line 34 def template return unless .template_path Template.new(.to_h.slice(:template_path, :template_position)) end |