class Docks::Themes::API::Components::Base

Attributes

block[R]

Public Class Methods

new(view, opts = {}, &block) click to toggle source
# File lib/docks_theme_api/components/base_component.rb, line 30
def initialize(view, opts = {}, &block)
  @view = view
  @attributes = opts
  @classes = Components.standardize_classes(opts.delete(:classes))
  @block = block
end

Public Instance Methods

==(other) click to toggle source
# File lib/docks_theme_api/components/base_component.rb, line 57
def ==(other)
  self.class == other.class && attributes == other.instance_variable_get(:@attributes)
end
classes(subcomponent = :base)
Alias for: classes_for
classes_for(subcomponent = :base) click to toggle source
# File lib/docks_theme_api/components/base_component.rb, line 51
def classes_for(subcomponent = :base)
  @classes.fetch(subcomponent, []).join(" ")
end
Also aliased as: classes
config() { |config| ... } click to toggle source
# File lib/docks_theme_api/components/base_component.rb, line 37
def config
  yield Config.new(self)
end
Also aliased as: configure
configure()
Alias for: config
inspect() click to toggle source
# File lib/docks_theme_api/components/base_component.rb, line 62
def inspect; to_s end
method_missing(meth, *args) click to toggle source
Calls superclass method
# File lib/docks_theme_api/components/base_component.rb, line 43
def method_missing(meth, *args)
   @attributes.key?(meth) ? @attributes[meth] : super
end
respond_to?(meth) click to toggle source
Calls superclass method
# File lib/docks_theme_api/components/base_component.rb, line 47
def respond_to?(meth)
  @attributes.has_key?(meth) || super
end
to_s() click to toggle source
# File lib/docks_theme_api/components/base_component.rb, line 61
def to_s; @attributes.to_s end