Module: IMW

Defined in:
lib/imw.rb,
lib/imw/uri.rb,
lib/imw/error.rb,
lib/imw/resource.rb,
lib/imw/recordizer.rb,
lib/imw/serializer.rb,
lib/imw/serializer/json_serializer.rb,
lib/imw/recordizer/string_slice_recordizer.rb,
lib/imw/recordizer/html_selector_recordizer.rb

Defined Under Namespace

Modules: Recordizer, Serializer Classes: Resource, Uri

Constant Summary collapse

Error =
Class.new(StandardError)
FileModeError =
Class.new(Error)
InvalidFormatError =
Class.new(Error)

Class Method Summary collapse

Class Method Details

.open(obj, options = {}, &block) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/imw.rb', line 14

def self.open obj, options={}, &block
  if obj.is_a?(IMW::Resource)
    resource = obj
  else
    options[:use_modules]  ||= (options[:as]      || [])
    options[:skip_modules] ||= (options[:without] || [])
    resource = IMW::Resource.new(obj, options)
  end
end