Module: DomReactorRedGlass

Defined in:
lib/domreactor-redglass.rb,
lib/domreactor-redglass/config.rb,
lib/domreactor-redglass/version.rb,
lib/domreactor-redglass/chain_reaction.rb

Defined Under Namespace

Classes: ChainReaction, Config

Constant Summary collapse

VERSION =
"0.0.6"

Instance Method Summary collapse

Instance Method Details

#auth_tokenObject



13
14
15
# File 'lib/domreactor-redglass.rb', line 13

def auth_token
  Config.auth_token
end

#auth_token=(auth_token) ⇒ Object



9
10
11
# File 'lib/domreactor-redglass.rb', line 9

def auth_token=(auth_token)
  Config.auth_token=auth_token
end

#create_chain_reaction(archive_location, opts) ⇒ Object



17
18
19
20
21
22
# File 'lib/domreactor-redglass.rb', line 17

def create_chain_reaction(archive_location, opts)
  archive_location = ArchiveLocation.new(archive_location, opts)
  archive_location.validate!
  @chain_reaction = ChainReaction.new(opts)
  @chain_reaction.post_archives(archive_location)
end

#parse_json_file(path) ⇒ Object



24
25
26
27
# File 'lib/domreactor-redglass.rb', line 24

def parse_json_file(path)
  json_str = File.open(path, 'rb') {|f| f.read}
  JSON.parse(json_str, symbolize_names: true)
end